Fix Image.Pixel.to_pixel/3 returning gamma encoded colors and 0..255 greys for scRGB images - #230
Merged
Conversation
Collaborator
|
Nice catch. Should we use |
Collaborator
Author
That's what it does now: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Breaking
Returns linear light for an
:scrgbimage. scRGB is linear, but the pixel was resolved withColor.SRGB, so every color between black and white came out too bright and desaturated. It now resolves withColor.RGBin the:SRGBworking space. Affects every function that resolves a color against an scRGB image.Before fix.

rebeccapurplecame out as[170, 124, 203](in sRGB) after being read back:After fix. Reads back as

[102, 51, 153]:Returns relative luminance for a single band
:scrgbimage. Single band scRGB images were given a0..255integer.:whiteresolved to255instead of1.0, and"#808080"to137instead of0.216. They now resolve to CIEY, matching how libvips collapses color to grey1.Footnotes
https://www.libvips.org/API/current/libvips-colour.html ↩