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
This was referenced Oct 9, 2026
This was referenced Oct 11, 2026
IhateTrains pushed a commit to ParadoxGameConverters/ImperatorToCK3 that referenced this pull request Oct 13, 2026
Updated [SixLabors.ImageSharp](https://github.com/SixLabors/ImageSharp)
from 4.1.2 to 4.1.3.

<details>
<summary>Release notes</summary>

_Sourced from [SixLabors.ImageSharp's
releases](https://github.com/SixLabors/ImageSharp/releases)._

## 4.1.3

## What's Changed
* Fix EXR encoder to write scaled values by @​JimBobSquarePants in
SixLabors/ImageSharp#3195
* Fix grayscale ICC profile conversion by @​JimBobSquarePants in
SixLabors/ImageSharp#3199
* Fix ICC rendering intent consistency and clamp sampled curves by
@​JimBobSquarePants in SixLabors/ImageSharp#3200
* Backport PNG cancellation buffer disposal fix to v4 by
@​JimBobSquarePants in SixLabors/ImageSharp#3209
* Backport lossy WebP buffer growth fix to v4 by @​JimBobSquarePants in
SixLabors/ImageSharp#3210
* Update v4 licensing infrastructure and security policy by
@​JimBobSquarePants in SixLabors/ImageSharp#3211


**Full Changelog**:
SixLabors/ImageSharp@v4.1.2...v4.1.3

Commits viewable in [compare
view](SixLabors/ImageSharp@v4.1.2...v4.1.3).
</details>

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=SixLabors.ImageSharp&package-manager=nuget&previous-version=4.1.2&new-version=4.1.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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