Skip to content

Add ICC profile support - #1335

Draft
BobLd wants to merge 1 commit into
UglyToad:masterfrom
BobLd:feature/icc-profile-support-2
Draft

Add ICC profile support#1335
BobLd wants to merge 1 commit into
UglyToad:masterfrom
BobLd:feature/icc-profile-support-2

Conversation

@BobLd

@BobLd BobLd commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

Adds optional ICC profile support to color handling, through a new ParsingOptions.IccProfileService and 3 new public interfaces (IIccProfileService, IIccProfile, IIccTransform) that resolve raw profile bytes into reusable, intent-aware, sRGB-producing transforms.

Rendering intent is now passed through the color pipeline via overloads on ColorSpaceDetails, with the param-less versions delegating to the PDF default (RelativeColorimetric); the graphics-state intent is propagated from ColorSpaceContext and image RenderingIntent flows through ColorSpaceDetailsByteConverter and PngFromPdfImageFactory.

ICCBasedColorSpaceDetails now resolves a profile when a service is configured, and otherwise falls back silently to its alternate color space. ResourceStore gained default color space substitution (DefaultGray/DefaultRGB/DefaultCMYK) and exposes the configured IIccProfileService.

A shared DenormalizeComponents helper centralizes mapping normalized [0,1] components to a space's native range (identity by default, overridden for Lab).

No actual implementation of ICC processing is made available directly in PdfPig. This PR should be seen in combination with BobLd/PdfPig.Rendering.Skia#103 This uses Wacton.Unicolour (cc @waacton for visibility) as ICC profile processor. UnicolourIccProfile is for the moment sitting with PdfPig.Rendering.Skia but will be split in its own NuGet package shortly.

@BobLd
BobLd force-pushed the feature/icc-profile-support-2 branch 5 times, most recently from bc0043b to 6701900 Compare June 20, 2026 18:26
…evel, do not ignore RI in SetNamedGraphicsState
@BobLd
BobLd force-pushed the feature/icc-profile-support-2 branch from 6701900 to 532443b Compare June 20, 2026 18:42
@BobLd

BobLd commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator Author

the scope of this PR is too big, I will split it in smaller pieces

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant