Repository navigation
Conversation
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.
Problem
imaging's ICC parser (prism/meta/icc) rejected Gray colorspace profiles: the header validator only allowed RGB/CMYK, and the matrix/TRC transformer builder only knew how to build RGB (3-curve + colorant matrix) pipelines. Sinceautometa.Loadparses ICC metadata before pixel decoding, any Gray-profile image would fail. You can check the problem with this image: https://www.wikidata.org/wiki/Q54883642#/media/File:Paloma-S%C3%A1nchez-Garnica.jpgChanges
profilereader.go: acceptColorSpaceGrayin header validation.tagtable.go: addedload_media_white_point()to read thewtpttag (also reused byget_effective_chromatic_adaption).pcs.go: addedGrayToXYZ/XYZToGraytransformer types implementing the ICC monochrome matrix/TRC model — an achromatic value is scaled by the media white point to produce (or is recovered from) PCS XYZ.profile.go:create_matrix_trc_transformernow delegates to a newcreate_gray_trc_transformerfor Gray profiles, using thekTRCcurve plus white-point scaling instead of the RGB colorant matrix.profile_gray_test.go: new test building a synthetic Gray ICC profile (parametric gammakTRC+wtpt) and verifying decode + round-trip gray → PCS → gray.