swap blend and base params to match effects in Photoshop #38
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When testing out the blend modes, I noticed that "Color Burn", "Color Dodge", "Soft Light", and "Hard Light" effects using pixi/picture are different from effects in Photoshop.
I've made a simple demo. The image on the left is rendered using pixi/picture, the image on the right is exported from Photoshop.
Here's the demo code and psd file.
demo_code_and_psd.zip
For most of the blend modes, I swapped the
blend
andbase
parameters.As with hard light, it is the same as overlay except that they expect layers in reverse order from each other. Since the 3rd parameter of mix function for overlay is
step(base, 0.5)
, the corresponding param for hard light should be1.0 - step(base, 0.5)
, not1.0 - step(blend, 0.5)
.