Merge pull request #9102 from dotCooCoo/feat/colorized-image-overprint

Images: Overprint Fill makes a colorized image's color overprint
This commit is contained in:
BFlat
2026-11-24 16:39:55 +07:00
committed by GitHub
30 changed files with 1176 additions and 112 deletions
+17 -4
View File
@@ -5140,12 +5140,25 @@ on OK. Cancel restores the original artwork.
Each fill and stroke (and each character's fill and stroke) can overprint: its inks print over the inks below instead
of knocking them out. `object.setOverprint {fill?, stroke?, item?, ids?}` sets it (groups set their contents, type its
characters too; `item` aims at one appearance item) and `attributes.info {ids?}` reads it back (`null` where the
characters too; `item` aims at one appearance item; without `item`, `fill` on a grayscale or 1-bit image colorized by
`paint.setFill` sets whether its color overprints) and `attributes.info {ids?}` reads it back (`null` where the
objects differ). Overprint Preview (`view.overprintPreview`) and Separations Preview show it; rendering approximates
it by darkening (the stronger ink of each plate wins, so a colour overprinting itself stays that colour). Older files that listed Overprint Black objects in the document get the flags on load.
it by darkening (the stronger ink of each plate wins, so a colour overprinting itself stays that colour). A colorized
image overprints as a whole: when one of its fills or strokes with an opacity above 0 draws a shape (Convert to Shape
or Outline Object) and does not overprint, the whole image knocks out in the previews and on printed plates. On
printed plates an image whose pixels do not take its color (a preview of its file) knocks out and prints as those
pixels. Older files that listed Overprint Black objects in the document get the flags on load.
PDF export writes them with `advanced.overprint: "preserve"` (the default): each overprinting fill and stroke sets a
graphics state with `/OP true /op true /OPM 1` (`/OPM 0` in PDF/A). With `discardWhiteOverprint` (`document.setup`, on by
default) white ones knock out instead; `"discard"` writes none.
default) white ones knock out instead, but not a tint above 0% of a spot swatch, which prints as that ink;
`"discard"` writes none. EPS export (`overprints: "preserve"`, the default) turns
overprinting on for a colorized image's color as it does for fills and strokes, except a white color with
`discardWhiteOverprint` on, which knocks out unless it is such a spot tint. PDF export writes an overprinting
colorized image in a gray or CMYK color in only the process inks the color puts down, and EPS export does too (one
DeviceN image at Level 3, one Separation image per ink at Level 2). The previews and printed separations show a
colorized image knocking out when it has a visible effect of its own other than a warp or a geometry effect (a drop
shadow, a glow, a raster effect or a color adjustment). PDF and EPS export leave raster effects out and still
overprint such an image.
```json
{"name":"run_command","arguments":{"command":"object.setOverprint","params":{"ids":[12],"stroke":true}}}
@@ -15514,7 +15527,7 @@ document's inks for print, as one undo step:
| `scope` | `selection`, `document` (the selection, or the document while nothing is selected) | What it fixes; `ids` stand for the selection |
| `inkLimit` | total ink % 1…400, 0 off (off) | CMYK colours (solid, gradient stops, gradient meshes) with more ink than this are scaled down to it; colours of spot swatches and Registration stay |
| `excludePureBlack` | bool (true) | Black-only CMYK and grey colours keep their ink |
| `removeWhiteOverprint` | bool (false) | White fills and strokes, and characters', stop overprinting |
| `removeWhiteOverprint` | bool (false) | White fills and strokes, characters' and the white color of a colorized image stop overprinting |
| `overprintBlack` | black % 1…100, 0 off (off) | Black-only and grey fills and strokes this dark or darker overprint, as `edit.colors.overprintBlack` sets it (not spot-linked or rich blacks) |
| `textOnly` | bool (false) | Overprint Black on type only |
| `fill`, `stroke` | bool (true) | Which paints the fixes reach |
+1
View File
@@ -2007,6 +2007,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
- **Colorized images (#1466):** a fill color applied to a selected grayscale or 1-bit image (`paint.setFill`) colorizes it with black, white, a process color or a spot color, and refuses a process color when the image has an alpha channel ([Convert color modes](https://web.archive.org/web/20251220223850/https://helpx.adobe.com/illustrator/desktop/manage-colors/select-and-adjust-colors/convert-color-modes.html), "Colorize Grayscale or 1-bit images"); black and white are accepted there too. The canvas draws each pixel in the color as far as the pixel is dark, with white pixels transparent; PDF export writes the image in the color (a spot color as its ink, Registration in every ink) with the image as its soft mask; Separations Preview and printed separations show it on its color's plates; native files keep the color. SVG writes the fill color through a coverage mask (or a colorized PNG in Tiny 1.2); EPS writes binary coverage as an image mask in the color's ink, and a grayscale image as ink samples scaled by coverage, with white pixels left out at Level 3 and gray midtones written over white.
The prompt for deleting several swatches and groups uses the interface language's plural form for the count. Evidence: `deleting_several_swatches_uses_each_count_form` in `crates/ui-egui/src/panels/swatches/tests.rs`.
- **Colorized images (#1466):** a fill color applied to a selected grayscale or 1-bit image (`paint.setFill`) colorizes it with black, white, a process color or a spot color, and refuses a process color when the image has an alpha channel ([Convert color modes](https://web.archive.org/web/20251220223850/https://helpx.adobe.com/illustrator/desktop/manage-colors/select-and-adjust-colors/convert-color-modes.html), "Colorize Grayscale or 1-bit images"); black and white are accepted there too. The canvas draws each pixel in the color as far as the pixel is dark, with white pixels transparent; PDF export writes the image in the color (a spot color as its ink, Registration in every ink) with the image as its soft mask; Separations Preview and printed separations show it on its color's plates; native files keep the color. EPS and SVG write the image's own pixels.
- **Colorized images overprint:** Overprint Fill (`object.setOverprint {fill: true}`) on a colorized grayscale or 1-bit image makes its color print over the inks below instead of knocking them out. Raster art has an overprint setting in the [scripting reference](https://ai-scripting.docsforadobe.dev/jsobjref/RasterItem/). `attributes.info` reports it, native files keep it, and Overprint Preview, Separations Preview and printed separations show it; they show an image knocking out when it has a visible effect of its own other than a warp or a geometry effect (a drop shadow, a glow, a raster effect or a color adjustment), or a fill or stroke with an opacity above 0 that draws a shape with Convert to Shape or Outline Object and does not overprint. Printed separations also show an image knocking out when its pixels do not take its color (a preview of its file), and separate those pixels as they are. PDF and EPS export leave raster effects out and still overprint such an image. PDF export draws the image with an overprinting graphics state and writes a gray or process color as an image of only the process inks it puts down (ISO 32000-1 §8.6.7). EPS export turns overprinting on for it and writes a gray or process color in only the process inks it puts down (one DeviceN image at Level 3, one Separation image per ink at Level 2). A legacy `.ai` file writes it with the image mask's fill overprint, and reading one takes the fill overprint in force at the image mask. White follows the rule for white fills: with Discard White Overprint on, PDF export, EPS export, the previews and printed separations show a white color knocking out, but a tint above 0% of a spot swatch whose color is white keeps overprinting, as it does for fills and strokes in PDF export, the previews and printed separations ([White overprint](https://helpx.adobe.com/illustrator/desktop/manage-colors/apply-transparency-and-blending/white-overprint.html)). Taking the color off with a fill of None also turns its overprint off. Edit › Edit Colors › Overprint Black and Print Ink Fixes' Remove White Overprint reach a colorized image's color as its fill. Evidence: engine `tests::colorize::overprint_fill_makes_a_colorized_images_color_overprint`, `tests::colorize::overprint_black_and_print_fixes_reach_a_colorized_images_color`, `tests::colorize::flattening_without_preserve_overprints_drops_a_colorized_images_overprint`, `tests::colorize::flattening_without_preserve_overprints_clears_an_uncolored_images_overprint`, doc `overprint::tests::a_white_colorized_image_knocks_out_under_discard_white`, `overprint::tests::a_white_spot_ink_keeps_overprinting_under_discard_white`, `overprint::tests::a_colorized_image_darkens_unless_its_rows_draw_an_effect`, `overprint::tests::a_colorized_image_darkens_past_a_row_with_no_opacity`, `overprint::tests::a_colorized_image_with_a_node_effect_keeps_knocking_out`, `overprint::tests::overprint_black_takes_a_black_colorized_image`, `overprint::tests::clearing_overprints_clears_the_flag_of_an_image_without_a_color`, render `tests::colorize::an_overprinting_colorized_image_keeps_the_ink_below_in_the_previews`, pdf `tests::colorize::an_overprinting_colorized_image_sets_overprint`, `tests::colorize::separations_hide_an_overprinting_image_on_plates_without_its_ink`, `tests::colorize::separations_show_an_overprinting_image_whose_pixels_refuse_its_color`, `tests::colorize::a_white_spot_ink_image_overprints_with_discard_white_overprint`, eps `tests::an_overprinting_colorized_image_writes_only_its_process_inks`, `tests::a_white_spot_ink_colorized_image_overprints_with_discard_white_overprint`, `tests::a_plate_leaves_out_an_overprinting_image_without_its_ink`, `tests::an_overprinting_colorized_image_at_the_page_limit_keeps_all_its_inks_or_none`, `legacy_ai::tests::a_colorized_image_mask_takes_the_fill_overprint_in_force`, doc `live::tests::mesh_warp_image_pieces_keep_an_overprinting_color`, effects `tests::an_image_under_a_geometry_effect_keeps_its_color_and_smoothing`.
- **Missing library files:** a persistent swatch or graphic style library panel whose file is gone at startup reopens and stays in the preferences, showing the file's path with Locate Library… (`ui.libraryPanel.locate`), which reads the file from where it is now into the same panel.
- **Swatch library and Recolor Artwork parameters:** the `swatch.library.*` commands, `swatch.resetDefaults`, the graphic style library save, load and add, the `recolor.*` commands and `color.harmony`'s `limitTo` refuse parameters of the wrong form, such as `names: "Grays"`, `limitTo: 5` or `includeImages: "false"`. Errors name the parameter, except that a `limitTo` that is not a string, such as `5`, gets an unknown-library error. A `null` counts as left out except for `recolor.apply`'s `model`, which must be a string when given.
- **OKLCH Sliders (Color Wheel panel):** as VectorCraft's own addition, the Color Wheel panel's menu item OKLCH Sliders (`ui.colorWheel {sliders: "oklch"}`, kept with the preferences) shows L, C and H rows under the wheel or the box that edit the color by the OKLCH lightness (0 to 100 %), chroma (0 to 100 % of 0.4) and hue (0 to 360°) of its display sRGB, as CSS Color 4 defines them (https://www.w3.org/TR/css-color-4/#specifying-oklab-oklch). Each track dims the colors outside sRGB, and a tick on the C track marks the largest chroma sRGB holds at the row's L and H; a color outside sRGB keeps L and H and takes the largest chroma that fits, and the C row keeps the chroma asked for. The rows take the arrow keys after a click and report their names, values, ranges and adjust actions to screen readers. While the active document's RGB space (its assigned profile, else the working RGB space of Edit › Color Settings) is not sRGB, the unchecked item is gray and `ui.colorWheel {sliders: "oklch"}` answers an error; rows shown before the space changed are gray, and the checked item still hides them. `color.convert {color, to: "oklch"}` answers the same L, C and H for a color inside sRGB. For a color outside sRGB, it clips the display RGB to 0 to 1 first, so its L, C and H can differ from the rows' values. Evidence: `crates/color/src/oklab.rs` tests; `convert_to_oklch_answers_lightness_chroma_and_hue` in `crates/engine/src/tests/colormgmt.rs`; the OKLCH tests in `crates/ui-egui/src/panels/tests_color_wheel.rs`, `the_oklch_tracks_dim_the_colors_outside_srgb_and_the_tick_marks_the_largest_chroma` and `oklch_sliders_are_gray_after_the_working_space_changes` among them. Scores and estimates are unchanged.