Image Tools: Color Mask hides chosen colors of an image while its pixels stay

Object › Plug-ins › Image Tools gains Color Mask… (`addon.image.colorMask`),
Remove Color Mask and Apply Color Mask. Color Mask hides colors of the
selected images without changing their pixels. It matches colors as Remove
Background does: the edge color, the corner color or picked colors, with
Contiguous, Match, Tolerance and Softness. The mask is kept with the image
object and saved with the document: its settings, and a PNG of the image's
pixels with the hidden colors made clear, at the source's depth with its
color profile and resolution. It is a VectorCraft addition.

- The canvas (clip groups and white-shape opacity masks included),
  printing and separations, PDF (soft masks of CMYK images included), SVG,
  EPS, the raster formats, the legacy .ai and .ai editing data, EMF/WMF,
  DXF and the flattener draw the masked pixels. A linked image stays
  linked, and an output that would refer to its file writes the masked
  pixels instead.
- Copy and paste, placing a document and placed documents carry the masked
  pixels with the image, under the names they are given there.
- The dialog opens on the selected image's mask settings, with a Preview.
  Without settings, the command returns them and changes nothing.
- Setting, removing and applying a mask are each one undo step, and no
  step is added when nothing changes. Apply makes the masked pixels the
  image's own and embeds a linked image. A mask that hides nothing is only
  taken off, and the image keeps its pixels and its link.
- When an image's own pixels are replaced (Update Link, Relink, Crop
  Image, a recolor, a linked file read again on open), its mask is made
  again for the new pixels, in every art tree and in opacity-mask art.
  Crop Image cuts the image's own pixels. When the new pixels can't be
  masked, the mask keeps its settings and hides nothing.
- Objects in `ids` that are not images, CMYK images, linked images that
  show their preview, images past the decode allowance, masks that would
  hide every pixel, and grayscale images colorized with a process color
  are refused. The Eyedropper, Object Mosaic, Create Gradient Mesh, Crop
  Image's trim and Image Trace read the image's own pixels.
- An image is selected by a click anywhere in its frame, as before.

Remove Background now also refuses a grayscale image colorized with a
process color. Its result has an alpha channel, and a process color is
refused on a grayscale image with transparency.

Docs: docs/mcp.md (Image Tools add-on › Color Mask),
docs/target-app-parity.md.
This commit is contained in:
dotCooCoo
2026-11-12 05:17:01 -08:00
parent 81247fdae9
commit 0779da299b
69 changed files with 1979 additions and 120 deletions
+55 -5
View File
@@ -9793,8 +9793,9 @@ there is no step. → `{symbols: [name…], ids: [instance id…], skipped: [{la
## Image Tools add-on
Image Tools is a built-in add-on for placed images: its command is `addon.image.removeBackground`, and in the desktop
app it lives in Object › Plug-ins › Image Tools. It is a VectorCraft addition.
Image Tools is a built-in add-on for placed images: its commands are `addon.image.removeBackground`,
`addon.image.colorMask`, `addon.image.removeColorMask` and `addon.image.applyColorMask`, and in the desktop app it
lives in Object › Plug-ins › Image Tools. It is a VectorCraft addition.
### Remove Background
@@ -9826,9 +9827,11 @@ change in one undo step, and an image that `ids` names twice changes once. An im
as it is, and when none changes the command adds no undo step and returns `changed: 0`. `cleared` counts the pixels
made fully clear in the images that changed. The command refuses, and changes nothing, when an image is CMYK, a linked
image shows its preview (embed or relink it first), an image would need more than the decode allowance while it is
worked on (2 GiB, or 512 MiB in the web app, counted from the file's header before it is decoded), or every pixel of an
image would be cleared. Remove Background… opens the command's dialog with Preview off; with Preview on, the canvas
shows the result for the values in the dialog, and Cancel puts the image back. While a dialog previews the command,
worked on (2 GiB, or 512 MiB in the web app, counted from the file's header before it is decoded), every pixel of an
image would be cleared, or a grayscale image colorized with a process color would get an alpha channel (a colorize
color on a grayscale image with transparency is a spot color, black or white). Remove Background… opens the command's
dialog with Preview off; with Preview on, the canvas shows the result for the values in the dialog, and Cancel puts the
image back. While a dialog previews the command,
the session keeps the decoded pixels of the images it changes (at most 128 MiB, or 32 MiB in the web app), so the next
preview step does not decode them again; it releases them when the dialog closes with OK or Cancel. A run that is not
a preview step does not keep them.
@@ -9839,6 +9842,53 @@ a preview step does not keep them.
{"name":"run_command","arguments":{"command":"addon.image.removeBackground","params":{"background":"corners","contiguous":false,"match":"channels","tolerance":12.55,"softness":0}}}
```
### Color Mask
`addon.image.colorMask` hides colors of the selected images, or of the images in `ids`, and leaves their pixels as
they are. It takes `background`, `colors`, `contiguous`, `match`, `tolerance` and `softness` with the same values,
defaults and refusals as `addon.image.removeBackground`, and matches colors the same way. The image keeps its own
pixels. The mask is kept with the image object and saved with the document: its settings, and a PNG of the image's
pixels with the hidden colors made clear (16-bit and gray images keep their depth and channels, with the source's color
profile and resolution). PDF's color key masking hides chosen colors of an image in a similar way
([ISO 32000-1 §8.9.6.4](https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008.pdf)).
- The canvas, printing and separations, PDF (PDF/X-1a and PDF/X-3 flatten the hidden pixels as transparency), SVG,
EPS, the raster formats, DXF, EMF, WMF, the legacy .ai, the .ai editing data, copy and paste, and placing a document
show the masked pixels. A linked image stays linked. An output that refers to linked files instead of embedding them
(SVG with `images: "link"`) writes the masked pixels in place of the link.
- A grayscale image's masked pixels have an alpha channel. A colorize color on a masked grayscale image follows the rule
for grayscale images with transparency (a spot color, black or white), and Color Mask refuses a grayscale image
colorized with a process color.
- A click anywhere in the image's frame selects it, hidden pixels included, as it does for an image with clear pixels.
The Eyedropper, Object Mosaic, Create Gradient Mesh, Crop Image's trim and Image Trace read the image's own pixels,
hidden colors included.
- Running the command again on a masked image replaces its mask. All the images change in one undo step. An image whose
mask does not change is left as it is, and when none changes the command adds no undo step and returns `changed: 0`.
`hidden` counts the pixels made fully clear in the images that changed.
- When the image's own pixels are replaced later (Update Link, Relink, Crop Image, a recolor, or a linked file read
again when the document opens), the mask is made again for the new pixels. When the new pixels can't be masked (CMYK
pixels, missing pixels, or every pixel would be hidden), the mask keeps its settings and hides nothing.
- The command refuses, and changes nothing, when an object in `ids` is not an image, an image is CMYK, a linked image
shows its preview (embed or relink it first), an image would need more than the decode allowance, or the mask would
hide every pixel of an image.
- With none of `background`, `colors`, `contiguous`, `match`, `tolerance` and `softness` given, nothing changes, and
the command returns the mask settings of the first image (the defaults when it has no mask) with `masked`. Color
Mask… opens the command's dialog on those settings, with a Preview that works as Remove Background's does.
→ `{changed, ids, hidden}`, or without settings `{background, colors, contiguous, match, tolerance, softness, masked}`
`addon.image.removeColorMask` takes the mask off the selected images, or the images in `ids`, in one undo step, and
the images show their own pixels again. `addon.image.applyColorMask` makes each mask part of its image: the masked
pixels become the image's own, embedded as a PNG with an alpha channel (a linked image is embedded), and the mask is
taken off, in one undo step. A mask that hides nothing is only taken off, and the image keeps its pixels and its link.
Images without a mask are left as they are, and an object in `ids` that is not an image is refused. Both commands are
enabled only when a selected image has a mask. → `{changed, ids}`
```json
{"name":"run_command","arguments":{"command":"addon.image.colorMask","params":{"background":"colors","colors":"#00ff00","contiguous":false,"tolerance":15,"softness":10}}}
{"name":"run_command","arguments":{"command":"addon.image.applyColorMask","params":{}}}
```
## Type Tools add-on
Type Tools is a built-in add-on for type: its commands are `addon.type.textTweaker` and `addon.type.releasePath`, and
+5 -1
View File
@@ -1999,7 +1999,11 @@ A VectorCraft addition (it replaces a script some users ran), so no area score m
## Image Tools add-on: Remove Background (2026-11-11)
A VectorCraft addition, so no area score moves. Object › Plug-ins › Image Tools › Remove Background… (`addon.image.removeBackground`) makes the background of the selected images transparent in their own pixels, in the app with no service or model. The background is the most common edge color (nothing is cleared when the edges hold at least as many clear pixels as pixels of that color), the average of the corners that are not clear, or picked colors. Contiguous (on by default) clears it only where it reaches in from an edge; off, it is cleared everywhere. Tolerance and Softness (0 to 100, 10 by default, VectorCraft's own values) set how near a color is cleared and the band over which pixels fade out, measured as RGB distance or, with Match set to Each Channel, as the largest difference on one channel. The run is one undo step, and none is recorded when no pixel changes. The image stays an image: a PNG with alpha at its own bit depth, gray or color as it was, with its color profile and resolution, and a linked image is embedded. CMYK images, linked images that show their preview, images that would need more than the decode allowance and results with no pixel left are refused. The dialog's Preview works as Release Type on a Path's does; its preview steps decode an image once, and the decoded pixels are released when the dialog closes. Tests: `cmd::addons::image::tests` in `vectorcraft-engine` (edge, corner and picked colors, contiguous on and off, a second run, tolerance and softness by distance and by channel, 16-bit and gray images, the color profile and resolution kept, an image read at another size, linked images, refusals and bad params, and decoded pixels reused across preview steps and released at OK and Cancel), `addons::image::tests::remove_background_previews_cancels_and_runs_on_ok` in `vectorcraft-ui-egui` and `command_sweep`. Commands: `docs/mcp.md` › Image Tools add-on. Since 2026-11-12 a selected image also offers Remove Background in the Contextual Task Bar, Properties › Quick Actions and the Control bar, where the reference app offers it (<https://community.adobe.com/announcements-651/ai-powered-image-editing-features-in-illustrator-1624061>); a click runs it at once with the defaults, as one undo step (tests `canvas::tests::the_task_bar_removes_a_selected_images_background` and `addons::image::tests::properties_and_the_control_bar_remove_the_background_at_once`).
A VectorCraft addition, so no area score moves. Object › Plug-ins › Image Tools › Remove Background… (`addon.image.removeBackground`) makes the background of the selected images transparent in their own pixels, in the app with no service or model. The background is the most common edge color (nothing is cleared when the edges hold at least as many clear pixels as pixels of that color), the average of the corners that are not clear, or picked colors. Contiguous (on by default) clears it only where it reaches in from an edge; off, it is cleared everywhere. Tolerance and Softness (0 to 100, 10 by default, VectorCraft's own values) set how near a color is cleared and the band over which pixels fade out, measured as RGB distance or, with Match set to Each Channel, as the largest difference on one channel. The run is one undo step, and none is recorded when no pixel changes. The image stays an image: a PNG with alpha at its own bit depth, gray or color as it was, with its color profile and resolution, and a linked image is embedded. CMYK images, linked images that show their preview, images that would need more than the decode allowance, results with no pixel left and grayscale images colorized with a process color are refused. The dialog's Preview works as Release Type on a Path's does; its preview steps decode an image once, and the decoded pixels are released when the dialog closes. Tests: `cmd::addons::image::tests` in `vectorcraft-engine` (edge, corner and picked colors, contiguous on and off, a second run, tolerance and softness by distance and by channel, 16-bit and gray images, the color profile and resolution kept, an image read at another size, linked images, refusals and bad params, and decoded pixels reused across preview steps and released at OK and Cancel), `addons::image::tests::remove_background_previews_cancels_and_runs_on_ok` in `vectorcraft-ui-egui` and `command_sweep`. Commands: `docs/mcp.md` › Image Tools add-on. Since 2026-11-12 a selected image also offers Remove Background in the Contextual Task Bar, Properties › Quick Actions and the Control bar, where the reference app offers it (<https://community.adobe.com/announcements-651/ai-powered-image-editing-features-in-illustrator-1624061>); a click runs it at once with the defaults, as one undo step (tests `canvas::tests::the_task_bar_removes_a_selected_images_background` and `addons::image::tests::properties_and_the_control_bar_remove_the_background_at_once`).
## Image Tools add-on: Color Mask (2026-11-12)
A VectorCraft addition, so no area score moves. Object › Plug-ins › Image Tools › Color Mask… (`addon.image.colorMask`) hides colors of the selected images while their pixels stay as they are. It matches colors as Remove Background does (edge, corner or picked colors, Contiguous, Match, Tolerance and Softness, VectorCraft's own values). The mask's settings and the masked pixels are kept with the image object and saved with the document. The canvas (clip groups and white-shape opacity masks included), printing and separations, PDF (PDF/X-1a flattens the hidden pixels), SVG, EPS, PNG, DXF, EMF, WMF, the legacy .ai, the .ai editing data, copy and paste, and placing a document show the masked pixels. A linked image stays linked, and outputs that would refer to its file write the masked pixels instead. A masked grayscale image takes only a spot, black or white colorize color. The dialog opens on the image's mask settings. Remove Color Mask takes the mask off, and Apply Color Mask makes it part of the image's pixels. Each is one undo step, and none is recorded when nothing changes. When the image's own pixels are replaced (a link updated or read again on open, the image cropped or recolored), the mask is made again for the new pixels. A click anywhere in the image's frame selects it. Tests: `cmd::addons::image::mask::tests` in `vectorcraft-engine` (hidden colors drawn, pixels kept, edit, report, remove and apply, the outputs listed, save and open, copy and paste, placing a document, a linked image, cropped and replaced pixels, colorize colors, refusals), `color_mask::tests` and `placed_document::tests` in `vectorcraft-doc`, the separations and CMYK soft-mask tests in `vectorcraft-pdf`, and `addons::image::tests::color_mask_previews_keeps_its_settings_and_comes_off` in `vectorcraft-ui-egui`. Commands: `docs/mcp.md` › Image Tools add-on › Color Mask.
## Color Effects add-on: Find Nearest Swatch (2026-11-01)