vectorcraft/crates/render/src
bflatastic ab62b5f8e8 Fix #320: CMYK images stay CMYK from PDF import to PDF export
A PDF's DeviceCMYK image opened as RGB (the interpreter's pixels as a PNG),
so every export wrote it as DeviceRGB or ICC RGB, silently. Images now keep
their CMYK samples, as CMYK colours already did:

- Model: CMYK images are blobs holding CMYK samples, a four-component JPEG
  (Adobe's inverted samples) or a Deflate CMYK TIFF. vectorcraft-doc's cmyk
  module reads their ink amounts (ImageBlob::is_cmyk, ::cmyk, capped at 64
  megapixels) and writes the TIFF (ImageBlob::cmyk_tiff).
- PDF import: DeviceCMYK, CalCMYK and four-component ICC images keep their
  samples. A JPEG with Decode [1 0 1 0 1 0 1 0] is kept byte for byte; any
  other is decoded (8 or 16 bits, its Decode array applied) and stored as a
  CMYK TIFF. Masked CMYK images and 1/2/4-bit ones open in RGB with a warning.
  Placing a CMYK TIFF keeps it CMYK too.
- PDF export: CMYK images are written in CMYK (DeviceCMYK, or ICC-based with
  the CMYK profile when colours are tagged: PDF/X-3, PDF/X-4, PDF/A). A CMYK
  JPEG neither resampled nor recompressed passes through unchanged; others are
  resampled in CMYK and compressed as ZIP or as a CMYK JPEG (jpeg-encoder,
  which also replaces the ZIP fallback and its warning for images converted to
  CMYK). Output conversion treats them like CMYK colours: Preserve Numbers and
  PDF/X-1a keep their numbers, Convert to Destination converts them to another
  CMYK profile or to RGB through a 17^4 lookup table (cms::CmykLut, now also
  behind the renderer's ink table). A CMYK image that can't be decoded is
  reported in the warnings.
- Canvas: CMYK images show through the working CMYK profile, as CMYK fills
  do, and paint their own inks in ink planes (CMYK raster exports, CMYK
  blending). SVG export writes TIFF images as PNG.

Illustrator's Output › No Conversion keeps colour data as it is
(https://helpx.adobe.com/illustrator/using/pdf-options.html).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 06:04:07 +07:00
..
encode Lint: as_chunks in two tests too (import_fuzz, render encode) 2026-10-05 12:14:56 -07:00
brush_fx.rs M4.39: SVG symbols as <symbol>/<use>, hidden layers on Save, Dublin Core metadata 2026-10-05 09:03:52 +07:00
freeform.rs M4.98: freeform gradients export to SVG as images clipped to their shapes 2026-10-05 13:25:16 +07:00
fx.rs M8.14: Type and symbols in perspective are really projected and stay editable; attachments survive copies 2026-10-06 12:10:00 +07:00
group.rs M4.34: raster export options and PNG Options — resolution, background, anti-aliasing, interlacing 2026-10-05 09:14:11 +07:00
ink.rs Fix #320: CMYK images stay CMYK from PDF import to PDF export 2026-10-08 06:04:07 +07:00
lib.rs Fix #320: CMYK images stay CMYK from PDF import to PDF export 2026-10-08 06:04:07 +07:00
live.rs M8.16: Envelopes bend images, symbols, gradients, patterns and appearance; warps keep their frame 2026-10-06 12:01:47 +07:00
paint.rs M3.98: radial annotator extent ellipse, aspect handle and off-centre focal point 2026-10-05 04:43:43 +07:00
pattern.rs M3.90: blend modes and opacity composite inks in CMYK documents 2026-10-05 04:30:06 +07:00
proof.rs M4.75: File → Print writes the job as a print-ready PDF: paper, scale, tiles, marks and bleed, separations 2026-10-05 15:13:10 +07:00
tests.rs Robustness: VectorCraft never crashes — no panics in shipped code 2026-10-05 06:28:59 +07:00
tests_adjust.rs Fix #122: colour adjustment live effects (Effect > Color Adjustments) 2026-10-06 00:42:26 +07:00
tests_blend.rs M3.73: blend modes follow the reference formulas on screen, in SVG and in PDF 2026-10-05 00:27:31 +07:00
tests_charstroke.rs M3.40: stroke on type — the Stroke panel edits the characters' stroke 2026-10-05 01:09:55 +07:00
tests_clip.rs M3.26: clipping sets with any clip shape 2026-10-04 17:23:57 +07:00
tests_cmykblend.rs M4.63: Links panel with status, Relink, Go To, Update, Edit Original, Embed/Unembed, Link Info and Placement Options 2026-10-05 12:40:05 +07:00
tests_container.rs M3.68: groups, layers and type have their own fills, strokes and effects, with Contents and Characters rows 2026-10-05 00:59:34 +07:00
tests_fontchange.rs Fix #36: the font menus list the installed fonts, with a search field 2026-10-06 00:49:22 +07:00
tests_freeform.rs M3.81: freeform gradients: colour points with spread, smooth lines, first points placed inside the shape 2026-10-05 01:21:38 +07:00
tests_isolation.rs M3.89: a clipping path's fill paints behind the clipped art, its stroke over it 2026-10-05 03:11:04 +07:00
tests_knockout.rs M3.48: Page Isolated Blending and Page Knockout Group 2026-10-04 23:10:06 +07:00
tests_layeropts.rs Layers: sublayers are layers, not objects, and every row has a command 2026-10-07 22:29:15 +07:00
tests_objectfx.rs M4.63: Links panel with status, Relink, Go To, Update, Edit Original, Embed/Unembed, Link Info and Placement Options 2026-10-05 12:40:05 +07:00
tests_setup.rs M4.63: Links panel with status, Relink, Go To, Update, Edit Original, Embed/Unembed, Link Info and Placement Options 2026-10-05 12:40:05 +07:00
tests_strokegradient.rs M3.83: gradients within, along or across a stroke 2026-10-05 05:47:54 +07:00
tests_tileedge.rs M3.72: Tile Edge Color dialog and Show Swatch Bounds in pattern editing 2026-10-05 01:50:25 +07:00