Repository navigation
Page.RenderCMYK: pages in the CMYK of the document - #235
Merged
Merged
Conversation
RenderCMYK draws into an *image.CMYK: DeviceCMYK and ICC CMYK keep their values, grey goes on black, Separation and DeviceN process colorants on their inks and other colorants through their alternate, RGB and CIE colours through the colour-to-ink table (B2A) of the document's CMYK profile where it has one and else as PDF converts DeviceRGB. The page is drawn twice through the RGBA pipeline, with colours projected as views of the document read them: cyan, magenta and yellow in red, green and blue, then black in all three. Groups composite inks with stilus v0.11.0's LayerShader.Subtractive and Black; luminosity soft masks are drawn in the grey of their CMYK colours. Display lists are cached per projection; Render is unchanged (corpus pixel-identical). internal/cmyk reads B2A0/B2A1 and converts XYZ to ink (Profile.Ink). Fixes #209
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.
Fixes #209 (cera side; the stilus side is stilus v0.11.0, bumped here).
Page.RenderCMYK(ctx, *image.CMYK, RenderOptions)draws a page in the CMYK of its document (output intent,OpenOptions.CMYKProfile, or SWOP):internal/cmyknow reads B2A0/B2A1,Profile.Ink), else PDF 10.4.2.4 (full GCR/UCR)LayerShader.Subtractive); the non-separable ones take black from backdrop or source (LayerShader.Black)How: the page is drawn twice through the RGBA pipeline, through views of the document that project colours as they are read: C, M, Y into R, G, B, then K into all three. Display lists and widget lists are cached per projection (
listKeygainsproj); colour spaces, shadings, patterns and images are per view as with #186.Checks
Renderunchanged: 113 corpus pages at 50 dpi pixel-identical to mainRenderCMYKon all 113 pages: no errors, ~2× the time ofRenderFollow-ups: a CMYK TIFF in
cmd/ceraneeds CMYK output in calamus' TIFF encoder; overprint per colorant (#155).