Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix color average #280

Merged
merged 1 commit into from
Oct 9, 2023
Merged

fix color average #280

merged 1 commit into from
Oct 9, 2023

Conversation

tonny008
Copy link
Contributor

@tonny008 tonny008 commented Sep 19, 2023

fixes #279

rOut = (rA * aA / 255) + (rB * aB * (255 - aA) / (255*255))
gOut = (gA * aA / 255) + (gB * aB * (255 - aA) / (255*255))
bOut = (bA * aA / 255) + (bB * aB * (255 - aA) / (255*255))
aOut = aA + (aB * (255 - aA) / 255)

@sksamuel
Copy link
Owner

Awesome thank you !

@sksamuel
Copy link
Owner

Looks like a test failure.

@tonny008
Copy link
Contributor Author

com.sksamuel.scrimage.core.ScalingDeadlockTest > image scale should not deadlock on multiple concurrent scales FAILED
    io.kotest.assertions.AssertionFailedError: expected:<50> but was:<49>
        at app//com.sksamuel.scrimage.core.ScalingDeadlockTest$1$1.invokeSuspend(ScalingDeadlockTest.kt:30)
        at app//com.sksamuel.scrimage.core.ScalingDeadlockTest$1$1.invoke(ScalingDeadlockTest.kt)
        at app//com.sksamuel.scrimage.core.ScalingDeadlockTest$1$1.invoke(ScalingDeadlockTest.kt)

val images = mutableListOf<ImmutableImage>() is it thread safe?

@sksamuel
Copy link
Owner

sksamuel commented Oct 9, 2023

Ah yeah I guess not.

@sksamuel sksamuel merged commit 0ac6e71 into sksamuel:master Oct 9, 2023
1 check failed
an-tex pushed a commit to an-tex/scrimage that referenced this pull request Mar 13, 2024
@tonny008 tonny008 deleted the patch-1 branch May 9, 2024 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

average implementation is not correct
2 participants