Save for Web: double-clicking a color-table swatch shifts that color

Double-clicking an opaque GIF or PNG-8 color-table swatch opens the
Color Picker. Its OK writes that color as the color picked wherever it
appears in the image; Cancel changes nothing. A shifted swatch shows the
original color at its upper left and the new one at its lower right,
with the lock mark. Double-clicking it opens the picker on the original
color, and OK on it takes the shift away. Unshift All Colors in the
table's menu clears shifts and web shifts.

- colorTable.shifted {"#source": "#rrggbb"} carries the shifts by
  source color, in the settings, the remembered settings and presets.
  A shifted color is kept when reducing, before locked colors, and wins
  over Web Shift, Web Snap and Lock; a color mapped to transparent stays
  transparent. Bad colors, duplicate keys and more than 256 entries are
  refused. The preview marks shifted colors.
- GIF lossy compression compares pixels with the reduction's colors
  before the table's edits, so a shifted or web-shifted color does not
  take in the pixels of a nearby color.
- Web Shift replaces a shift by hand, Lock stays on for a shifted color,
  and Delete Color drops a deleted color's shift.

Docs: docs/mcp.md, docs/target-app-parity.md.
This commit is contained in:
dotCooCoo
2026-11-17 14:28:52 -08:00
parent c9812414ce
commit 2209a64dc2
34 changed files with 470 additions and 28 deletions
+19 -2
View File
@@ -9018,7 +9018,7 @@ File → Export → Save for Web (Legacy) writes optimised web images: `document
…}` renders the artboard (`clipToArtboard`, the default; `artboard` picks one) or the visible art and the slices, at
`width`, `height` or `percent`, and encodes it with the format's settings: for GIF and PNG-8 `reduction`, `colors`,
`dither`, `ditherAmount`, `transparency`, `matte`, `interlaced`, `webSnap`, `lossy` (GIF) and `colorTable {locked,
transparent, webShift, sort, deleted, customPalette}`; for JPEG `quality`, `progressive`, `optimized`, `embedProfile` and `matte`; for PNG-24
transparent, webShift, sort, deleted, customPalette, shifted}`; for JPEG `quality`, `progressive`, `optimized`, `embedProfile` and `matte`; for PNG-24
`transparency`, `matte` and `interlaced`. `metadata` (none, copyright, contact, all) writes File Info as PNG text or a
GIF/JPEG comment; `convertToSrgb` marks PNGs as sRGB. `<stem>` is the name of `path` without its extension, or
without `path` the document's title with the characters Windows does not allow in a file name as `-` and a `-` after
@@ -9031,7 +9031,7 @@ couldn't be decoded and is missing from the image; the files are written all the
`document.exportForWeb.preview` returns what Save writes for the same settings without writing it: `bytes` (the exact
file size), `seconds` to download at `kbps` (default 56.6), the size, and for palette formats the colour table
(`colors: [{color, source, transparent, locked, webShifted, webSafe}]`). The colour table's lists name colours by
(`colors: [{color, source, transparent, locked, webShifted, shifted, webSafe}]`). The colour table's lists name colours by
`source` (the colour the reduction made), so a colour keeps its edits when it is web-shifted or snapped. `slice: n`
previews one slice; `image: true` adds the file; `warnings` holds the export's warnings.
@@ -9050,6 +9050,23 @@ clicked). The trash button and Delete Color in the table's menu delete the selec
Table in that menu clears `deleted` and `customPalette`, and the table reads Custom while either is set. Choosing
another reduction in the dialog also clears them.
Shifting a color is `colorTable.shifted: {"#source": "#rrggbb"…}`, by `source`: every pixel of that color is
written as the color given, in the preview and the file. The color is kept when the colors are reduced, as a
locked one is: the shifted and locked colors take the palette's slots first, shifted ones before locked ones, and at
least one slot is left for the reduction, so with `colors: 2` and transparent pixels none is kept and a color left out
shifts nothing. As with a locked color, a kept source stays in the palette when the art no longer has it, and the
pixels nearest to it are written in the new color. The preview marks it `shifted` and `locked`. A shift by hand wins over `webShift`, `webSnap` and
`locked`; a color mapped to transparent stays transparent. Two colors may be shifted to the same color. A source the
table does not hold shifts nothing, and the shift stays with the settings for when it comes back; another reduction
keeps it. The settings store the map in lowercase, drop a color shifted to itself or deleted, and drop the `webShift`
of a color shifted by hand. More than 256 entries, a key or value that is not a color such as `#ff8800` (`#rrggbbaa`
included), and two keys that name one color are errors. Presets and `webExport.settings` keep the map. In the dialog a double-click on an
opaque swatch opens the Color Picker on the color shown (on the source color for a color already shifted; an agent
sets `__editColor: "#source"`). Its OK shifts the color (picking the source color takes the shift away), and Cancel
leaves the table as it was. A shifted swatch shows the source color at its upper left and the new color at its lower
right, with the lock mark, and Lock stays on until the color is unshifted. Web Shift replaces a shift by hand, and
Unshift All Colors in the table's menu clears `shifted` and `webShift`. Only Web Colors in the picker starts off.
```json
{"name":"run_command","arguments":{"command":"document.exportForWeb.preview","params":{"format":"png8","colorTable":{"deleted":["#ff0000"],"customPalette":["#0000ff","#00ff00","#ff0000"]}}}}
```
+1
View File
@@ -894,6 +894,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
- Save for Web: Optimize to File Size… opens rows for a desired file size in K, Start With (Current Settings, Auto Select GIF/JPEG) and, with slices, Use (Total of All Slices, Each Slice, Current Slice); OK takes the settings whose files fit and shows the size found, or says that no setting tried fits ([the help page](https://help.adobe.com/archive/en_US/illustrator/cs4/illustrator_cs4_help.pdf#page=395)). The search lowers JPEG quality or palette colors (GIF then lossy) and encodes at most 32 trial settings; Auto Select chooses GIF for transparent art or art of at most 256 colors and JPEG otherwise. The slices share one setting, so every Use choice changes all of them (`webExport.optimizeToFileSize`). Scores and estimates are unchanged.
- Save for Web: while Alt (Option on macOS) is held, the dialog's Cancel button reads Reset, which puts the remembered settings back on the document's active artboard and leaves the dialog open (`ui.dialogReset`).
- Save for Web: the color table's trash button and Delete Color in its menu remove the selected GIF or PNG-8 colors, and their pixels take the nearest color left in the palette ([the help page](https://help.adobe.com/archive/en_US/illustrator/cs4/illustrator_cs4_help.pdf#page=404)). Click selects one color, Shift-click a range and Ctrl-click (Command-click on macOS) adds or removes one ([the help page](https://help.adobe.com/archive/en_US/illustrator/cs3/illustrator_cs3_help.pdf#page=398)). After the first deletion the table is a fixed Custom palette, so deleted colors stay out when the preview updates. These rules are VectorCraft's own: a deleted color is no longer locked, transparent or web-shifted; deleting every opaque color is refused; Restore Generated Table in the menu, or another reduction, goes back to the generated palette; presets and the remembered settings keep the edit (`colorTable.deleted`, `colorTable.customPalette`). Fixed palettes can also use all 256 entries when nothing is transparent. Scores and estimates are unchanged.
- Save for Web: double-clicking a GIF or PNG-8 color-table swatch opens the Color Picker, and its OK changes that color to the one picked everywhere it appears in the image. The swatch then shows the original color in its upper-left half and the new one in its lower-right half, with the lock mark, and the color stays through a lower color count. Double-clicking a changed swatch opens the picker on the original color, and OK on it changes the color back; Unshift All Colors in the table's menu undoes every change, web shifts included ([the help page](https://help.adobe.com/archive/en_US/illustrator/cs3/illustrator_cs3_help.pdf#page=383)). These rules are VectorCraft's own: Cancel changes nothing; a changed color wins over Web Shift, Web Snap and Lock, and pressing Web Shift replaces it; a color mapped to transparent stays transparent; two colors may change to the same color; a changed color takes a kept palette slot before a locked one, and one slot always stays for the reduction; the change is kept by source color when the reduction changes and applies only while that source is in the table; presets and the remembered settings keep it; the picker opens with Only Web Colors off (`colorTable.shifted`). GIF lossy compression now compares pixels with the reduction's colors, so a changed color does not take in another color's pixels. Scores and estimates are unchanged.
- Export for Screens, Save for Web (slice images, and files named after the document's title) and the Libraries panel name files with the characters Windows does not allow written as `-` and with a `-` after a Windows device name such as `CON`, on every platform (`document.exportForScreens`, `document.exportForWeb`, `library.create`).
- Variables (data merge): text, visibility and image variables bound to objects (an object may carry several), dataset rows applied in one undo step (`variable.*`, `dataset.*`) from a Variables panel and Window › Variables, with dialogs to define, bind and edit, Make Text/Visibility/Image Dynamic, Capture/Update Data Set, CSV import/export (`dataset.import` / `dataset.export`), and a row in italics when an edit leaves the art not matching it; an image dataset value is a file path and apply keeps the object's bounds; bindings let go of deleted art and locked art is left alone except by visibility values; every command, like the rest, is drivable over MCP and the CLI.
- Export for Screens numbers distinct row files whose names collide, compared without case, as `-2`, `-3`… instead of leaving them out; identical rows still write one file. It puts row folders that differ only in case into one folder (`document.exportForScreens`).