Skip to content

Fix ICC rendering intent consistency and clamp sampled curves - #3200

Merged
JimBobSquarePants merged 1 commit into
release/4.1.xfrom
js/fix-icc-rendering-intent-3198
Sep 21, 2026
Merged

JimBobSquarePants merged 1 commit into
release/4.1.xfrom
js/fix-icc-rendering-intent-3198

Conversation

@JimBobSquarePants

@JimBobSquarePants JimBobSquarePants commented Sep 21, 2026

Copy link
Copy Markdown
Member

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

Description

Fixes the ColorProfileHandling.Convert discrepancy 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. Preserve behavior 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 IccConverterBase filenames.

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:

  • Full Release suites on .NET 8 and .NET 10 each completed with 47,832 passed, 11 skipped, and one YCCK JPEG reference mismatch before that reference was promoted.
  • The YCCK failure was reproduced in isolation on .NET 8. Its reviewed output was promoted and verified byte-for-byte; the test has not been rerun after promotion.
  • The TIFF regression passes on .NET 8 Release with the normal allocator and the final 0.0001% tolerance.

Overlap check: #3023 targets main and changes the same ICC base files for nullability cleanup; it does not implement this rendering-intent fix. This PR targets release/4.1.x.

@JimBobSquarePants
JimBobSquarePants merged commit 6c874b9 into release/4.1.x Sep 21, 2026
11 checks passed
@JimBobSquarePants
JimBobSquarePants deleted the js/fix-icc-rendering-intent-3198 branch September 21, 2026 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant