Repository navigation
Image.DecodeCmyk, and the canvas without the experimental marker - #21
Merged
Merged
Conversation
A four-component JPEG (YCCK included) or a separated TIFF decodes to a CmykImage: C, M, Y and K as L8 planes in LinearSrgb, 0 no ink to 255 full, with the file's CMYK profile. Map runs an operation on every plane, ToInterleaved gives the bytes a PDF DeviceCMYK image holds, ToSrgb converts as Decode does. Shrink-on-load and orientation reuse the decoders' own paths; no operation or encoder changes. Checked against ImageMagick's raw CMYK in the gate. A 4000 x 3000 file: 103 ms, against 99 ms to sRGB.
The canvas, Shape and FillRule no longer carry [Experimental(ZORGDRAW)], so callers don't need to suppress a diagnostic to use them. The shipped API lines lose their [ZORGDRAW] prefix; the NoWarns go from the projects and the docs.
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.
Two changes for Zorg.Pdf, ahead of 0.5.0.
Image.DecodeCmyk. It decodes a CMYK JPEG (YCCK included) or a separated TIFF as its inks instead of converting to sRGB. The result is aCmykImage: fourL8planes running from 0 (no ink) to 255 (full ink), plus the file's CMYK profile. It's for print work, such as keeping a PDF image asDeviceCMYK.Mapapplies one operation (Fit,Crop,Rotate, ...) to every plane alike.ToInterleavedreturns C, M, Y, K per pixel.ToSrgbconverts for the screen and gives the same pixels asDecode.nullfor files that aren't CMYK, decided from the header without decoding.Decode.Decode's 99 ms. Plain RGB JPEG decoding is unchanged at 31 ms.docs/cmyk.md.The canvas is no longer experimental.
Canvas,ShapeandFillRuledrop[Experimental("ZORGDRAW")], so using them no longer needs aNoWarn. Removing the attribute doesn't break callers: projects that suppressed the diagnostic keep building. The shipped API lines lose their[ZORGDRAW]prefix.Tests:
magick ... cmyk:-within one level.