Fix ICC rendering intent consistency and clamp sampled curves - #3200
Merged
JimBobSquarePants merged 1 commit intoSep 21, 2026
Merged
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.
Prerequisites
Description
Fixes the
ColorProfileHandling.Convertdiscrepancy in #3198. When the source profile requests relative colorimetric intent but the destination profile header specifies perceptual intent, conversion currently mixes the two intents and applies an incorrect perceptual PCS adjustment. Resolve the source intent once and use it for both transform selection and PCS adjustment, for scalar and span conversions.Preservebehavior is unchanged.Clamp sampled ICC curve inputs to [0, 1] before scaling to table indices, preventing extrapolation and out-of-range lookup. Correct the casing of the two
IccConverterBasefilenames.Regression coverage compares scalar and span conversion against Unicolour with an explicit shared intent, and the reporter's TIFF against a LittleCMS 2.19 reference. The TIFF comparison allows 0.0001% aggregate difference; the measured difference is 0.000083%, with no channel differing by more than one 8-bit value. Add LUT endpoint coverage for out-of-domain and non-finite inputs. Update the existing YCCK JPEG reference with the reviewed output from the corrected conversion.
Validation:
Overlap check: #3023 targets
mainand changes the same ICC base files for nullability cleanup; it does not implement this rendering-intent fix. This PR targetsrelease/4.1.x.