An empty or blank `path` was treated as no path, so the command
returned `dataBase64` and wrote no file. It is now an error, and a
`path` left out still returns the file as `dataBase64`.
With slices set to Selected and no slice selected, Save Color Table
failed with "no selected slice in the image" although the dialog's
preview shows the whole image's table. Without a `slice` parameter the
command no longer looks up the slices; a `slice` is still looked up
among the slices `slices` names. The preview is unchanged.
Docs: docs/mcp.md.
With Transparency on, GIF and PNG-8 now offer Transparency Dither: No
Transparency Dither (the default, the half-opacity cut as before),
Diffusion with an Amount, Pattern and Noise. The help page describes the
four methods and the Diffusion amount:
https://help.adobe.com/archive/en_US/illustrator/cs4/illustrator_cs4_help.pdf#page=400
- render: `clear_mask` decides which pixels take the transparent entry.
Diffusion spreads the opacity error Floyd-Steinberg style over two rows,
scaled by the amount; Pattern uses the 8x8 ordered matrix and Noise a
fixed coordinate hash, so the same art always gives the same file. Fully
clear and fully opaque pixels do not change. `quantize_locked`,
`quantize_to`, `nearest_entries` and the fixed-palette path use it.
- engine: `document.exportForWeb`, its preview, `webExport.settings` and
presets take `transparencyDither` (none, diffusion, pattern, noise) and
`transparencyDitherAmount` (0 to 100, default 100). An unknown method or
an amount over 100 is refused; settings saved without the keys take the
defaults.
- ui: the Transparency Dither row sits under Transparency, with an Amount
slider for Diffusion; both are disabled while Transparency is off and
keep their values. Rows for the five labels are in every complete
catalog.
The matrix, the noise, the amount mapping and the defaults' combination
with the matte are VectorCraft's own rules.
Docs: docs/mcp.md, docs/target-app-parity.md.
- With transparent pixels, a fixed palette's colors mapped to
transparent share the transparent pixels' slot, so at Colors 256 all
255 opaque colors keep their entries.
- The preview's mappedToTransparent lists a color mapped to transparent
that did not fit in the fixed palette when its pixels became
transparent.
- When Colors leaves a fixed palette fewer slots than it has opaque
colors, shifted colors keep their slots first, then locked ones, then
the others in palette order. The file keeps the palette's order.
- quantize::nearest_entries hands each pixel's entry to a callback
instead of collecting one per pixel.
- A GIF lossy test with one fixed entry of three.
Docs: params text, docs/mcp.md.
The color table's menu gains Save Color Table… and Load Color Table…,
as the help page describes
(https://help.adobe.com/archive/en_US/illustrator/cs4/illustrator_cs4_help.pdf#page=404).
- document.exportForWeb.saveColorTable writes the GIF or PNG-8 table the
preview shows as a color table file in the published layout
(https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/): 256
RGB entries in file order, zero-padded, then the color count and the
transparent index, two bytes each, big-endian (65535 for none). It
always writes 772 bytes and writes shifted colors as written.
- webExport.loadColorTable reads the 768-byte and 772-byte forms and
returns the settings with the file's colors, other than the transparent
entry, as the fixed Custom palette and Colors set to the file's count.
The table's other edits and its sort are cleared and Web Snap is set
to 0, so the loaded colors are written as they are. It reads at most
773 bytes, rejects other sizes, counts of 0 or above 256, both or
neither of path and dataBase64, and JPEG or PNG-24, and remembers
nothing. Load Color Table… is disabled on the web.
- document.exportForWeb.preview rejects a slice that is not a whole
number from 1 up instead of ignoring it.
Docs: docs/mcp.md, docs/target-app-parity.md.
Web shift and web snap now run before lossy compression again, so a pixel
is compared with the color its neighbor's entry is written as. Colors
shifted by hand are written after lossy, which still moves no pixel into
or out of them.
With transparent pixels and Colors at 256, a custom palette of one opaque color and 255 colors mapped to transparent has no room for the last of those, and its pixels took the nearest entry left, which could be the opaque color. Such pixels now take the transparent entry when their nearest color is one that did not fit.
With a fixed palette (Custom table), the colors listed in colorTable.transparent
all become the one transparent entry, so together they now take a single slot of
Colors, and the opaque colors fill the remaining slots in palette order. Before,
the palette was cut to its first entries; when those were all mapped to
transparent, every opaque pixel took one of them and the whole image turned
transparent, and with a deleted color the export was refused although an opaque
color was left past the cut. The check that a deletion leaves an opaque color
now reads the whole palette.
When no pixel is transparent and no pixel takes a color mapped to transparent,
that slot goes to the next opaque color. At 256 colors one entry stays for a
color mapped to transparent.
Lossy compression compared each pixel with the reduction's colors, so a pixel next to a color shifted by hand could join that color and be written in its new color, and a pixel of the shifted color could leave it. Lossy now leaves the entries of shifted colors alone, as it does the transparent entry.
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.
The color table's trash button and Delete Color in its new menu delete
the selected GIF or PNG-8 colors. Pixels that used a deleted color take
the nearest color left, with the current reduction's color distance and
dither, and the preview matches the saved file. A click selects one
color and makes it the anchor, Shift-click selects the range from the
anchor, and Ctrl-click (Command-click on macOS) adds or removes one.
- colorTable.deleted lists the deleted colors by source. A deleted color
leaves the locked, transparent and webShift lists.
- colorTable.customPalette fixes the palette at the first deletion, so a
deleted color is not made again; the table reads Custom. Restore
Generated Table in the menu, or another reduction, clears both.
- Deleting every opaque color, or every color not mapped to transparent,
is an error and changes nothing.
- Presets and the remembered settings keep the edit.
- quantize_to uses all 256 fixed colors when no pixel is transparent.
Docs: docs/mcp.md, docs/target-app-parity.md.
With Transparency off, Optimize to File Size's Auto Select counts the
colors of the pixels blended over the matte, which are the colors the
file is written with, so art whose blended pixels need more than 256
colors starts with JPEG instead of GIF.
Optimize to File Size… under Preset opens rows for a desired size in K (1024 bytes), 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, measured by encoding, and the dialog shows
the size found or says that no setting tried fits.
- webExport.optimizeToFileSize searches JPEG quality or GIF/PNG-8 colors, then GIF lossy 100,
encoding at most 32 trial settings. A lower value can give a larger file, so it measures up to
6 values spread over the range before it narrows the step. It writes no file and changes no
remembered setting.
- A desiredK that is missing, not a number, 0 or less, or above 1048576 is an error, as are an
unknown startWith or use and a bad slice.
- The slices share one setting, so every Use choice changes all of them.
- The result line is dropped when the art or the selection changes.
Docs: docs/mcp.md, docs/target-app-parity.md.
vectorcraft_testkit::temp_dir returns a bare path, so every engine test
that wrote into one left the folder in the system temporary folder.
- testkit: TempDir, a test's own folder made through temp_dir (same
private creation and ownership checks) under a tag no other TempDir in
the process uses, removed with its contents when dropped, also when
the test panics.
- Engine unit and integration tests hold a TempDir for the whole test
instead of calling temp_dir: graph, fileio, compare, journal, library,
shortcut set, spelling, store, web export, cancel, containers, build,
color settings, command sweep, font folder, removed font, model-based
and the font search fuzz.
- The DCS and swatch library tests' own helpers and the PDF editing
tests' shared vc-pdfedit-<pid> folder use a TempDir per test too.
- The font and link file search, store, color settings and font folder
helpers no longer delete the private folder temp_dir checked and make
it again with default permissions.