Skip to content

Fix grayscale ICC profile conversion - #3199

Merged
JimBobSquarePants merged 1 commit into
release/4.1.xfrom
js/fix-gray-icc-3197
Sep 21, 2026
Merged

JimBobSquarePants merged 1 commit into
release/4.1.xfrom
js/fix-gray-icc-3197

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 #3197.

Converting a grayscale JPEG with an embedded ICC profile could wash out its tones because the gray TRC result was not expanded into the profile connection space. Construct neutral D50 XYZ or Lab values from the curve result, and use XYZ luminance or Lab lightness for the inverse conversion. Evaluate the single curve directly and precompute the encoded D50 white point.

Add XYZ/Lab calculator tests and a JPEG regression using the reporter's image with a full-image reference generated by LittleCMS 2.19 using the embedded source profile and CompactSrgbV4Profile target.

Validation: the full Release suite passed on .NET 8 and .NET 10, each with 47,814 passed, 11 skipped, and no failures. After the final test-only change to reuse KnownIlluminants.D50Icc, all 12 affected tests passed again on both runtimes.

Overlap check: #3023 touches the same ICC files for nullable annotations on main. This fix targets release/4.1.x; no duplicate fix was found.

@JimBobSquarePants
JimBobSquarePants merged commit 42b7160 into release/4.1.x Sep 21, 2026
16 of 21 checks passed
@JimBobSquarePants
JimBobSquarePants deleted the js/fix-gray-icc-3197 branch September 21, 2026 04:30
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