Improvements for non-rgb modes and transparency #319
Merged
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.
Context
Proposing a number of improvements to better support other image modes (mainly using CMYK) in
layer.topil
andlayer.composite
. As listed below:This PR also brings all these improvements to layer.composite() by re-using the
post-process
logic.This is a test PSD file, using created using the CMYK 8-bit image mode (I had to zip because github doesn't allow PSD file upload): CMYK-psd-tools-demo.psd.zip
The test file is has the following layers:
This is what layer.topil() returns on the "cat layer" (pixel layer)
This is what layer.composite() returns for the shape layer that clips the pixel layer of a dog. It's hard to see in github, but there is some proper transparency on this image, not just a white background:
.
Let me know if you have any feedback or suggestions, I am happy to take that onboard