Measure effect-bearing Align to Path content after spine placement, retaining
the conservative envelope and covering damage containment with original
software-rendered move and Undo controls.
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.
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.
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.
A damaged .ai can give a gradient mesh whose outline is enormous but finite.
draw_mesh_raster flattened that whole outline in device pixels (grown_outline),
and kurbo's flatten then asked for more segments than memory holds: a
"capacity overflow" panic (seen in import_fuzz's ai_written_meshes_never_panic).
An outline wider or taller than 2^24 device pixels now goes to the per-quad
drawing path the function already falls back to.
A VP8 key frame stores its first partition's size in 19 bits (RFC 6386
section 9.1). The encoder writes 524,287 for a larger partition too, and
a decoder then reads the token partition from the wrong offset. A lossy
WebP whose size field is at that limit now fails with an error that
suggests a lower resolution or Lossless, instead of writing a file that
does not decode.
On a path or compound path, a Transform effect with copies listed after
the object's own Rasterize effect now places the one image Rasterize
makes of the art before it on the original and on each copy: copy k
through the effect's map applied k times, with its pixel grid and its
room around the art, the last copy lowest and the original on top.
Before, the Transform effect copied the art and Rasterize made one image
of all the copies on a grid square to the page.
The image is made once for every placement, also when a shadow or glow
is listed between the Rasterize and Transform effects. The canvas, the
object's bounds, Expand Appearance and PDF export use the same
placements; Expand Appearance and PDF export make a group of images that
share the one image's pixels. Copies stop where the copied art stops,
and a copy scaled to nothing is left out.
WebP Options has a Compression menu (Lossless, Lossy) and a Quality
slider from 0 to 100 that is enabled for Lossy. document.export,
document.serialize and Export for Screens take lossless: false with
quality (default 90) and write a VP8 file, with an ALPH chunk that keeps
the alpha exactly when some pixels are not opaque. Lossless stays the
default. A WebP quality above 100, or one that is not a whole number,
is refused with an error.
The encoder is the one craft-image-codecs already provides; no
dependency changes. The note that lossy WebP isn't available, its
catalog rows and the format text that described it are removed.
The export walks for type and fonts and the artboard crop shared one
SymbolBoxes for every object. A SymbolBoxes also holds measuring budgets
(effect reaches, 9-slice placements), so in a large document objects late
in a walk could be measured by estimates where main measured them exactly.
SymbolBoxes::unmeasured makes new boxes that share the name index, and each
object is measured in boxes of its own again.
- The live-object walk (render/src/live.rs) finds symbols through the
frame's SymbolBoxes.
- SVG export's filter regions measure each object in unmeasured boxes, and
the region boxes share the writer's index.
- SVG import keeps each imported symbol's index, so a symbol whose art
holds instances no longer scans or indexes the list again.
- Object › Rasterize's clipping mask is left as it is on main, with
drawn_outline_with removed.
- The symbol-read-count feature of vectorcraft-doc gives other crates'
tests vectorcraft_doc::symbols_read. New tests check that a frame, an SVG
export, a PDF export, the type walk and the artboard crop read the symbol
list once among 2,000 symbols and 300 instances with drop shadows.
A sixth Image Trace View, Split View, draws the source image on the part
of the image left of a divider across it, and the tracing result
everywhere else, art past the image's edges included. The divider
follows the image's own width, so it turns with the image, and it works
at any zoom and view rotation. Each side is drawn once under a plain
clip; exports, printing and Expand still draw the tracing result.
- imageTrace.setView takes view "split" and split (0 to 1, default
0.5). A split outside 0 to 1, or one that is not a number, is an
error. The object keeps the divider when another view is set and when
it is traced again, and setting the same view and divider adds no
undo step.
- With one such object selected, the Selection tool drags the divider
as one undo step, and Escape cancels the drag. The divider is hidden
and cannot be dragged with the bounding box hidden or in Outline mode.
- The Image Trace and Properties panels show a Divider slider that the
arrow keys move a percent at a time, named for screen readers.
- The catalogs gain rows for Split View and Divider (all but gu, which
has no Image Trace rows).
Drawing or exporting a symbol instance looked its symbol up by scanning
the document's symbol list, so a document with many instances and many
symbols spent most of a frame or an export on name comparisons. The
renderer, the SVG and PDF writers and the export walks now find symbols
through SymbolBoxes::symbol, which builds the name index once per frame,
export or walk and returns the first symbol of a name as before.
- Renderer: plain instances, inline graphics, instances with object
effects (their art and the symbol budget) and the effect bounds.
- SVG export: instance art, symbol defs and their reuse check, and the
paint reach of filter regions.
- PDF export: instance art, inline graphics and the brush search of
knockout masks.
- Export warnings and artboard crops measured what each object paints
with new symbol boxes per object, which built the name index again for
every instance. painted_bounds_with and drawn_outline_with take the
boxes once; Object › Rasterize's clipping mask uses them too.
The canvas flattened a stroke's outline at 0.25 device pixels with chords
inside each curve, so a wide curved stroke's outer rim drew too light and
its inner rim too dark. A stroke at least 32 drawing tolerances wide now
draws each curve of its outline that spans 128 tolerances or more as lines
placed by its bend, with each line end moved outward by half the line's
bulge, so the lines lie on both sides of the curve. That is 8 and 32
device pixels at 25% and 1:1, and as little as just over 4 and 16 device
pixels at other zooms, where the cached outline's tolerance is the largest
power of two at or below a quarter device pixel.
At 25% zoom an 80 pt ring's worst edge pixel is 24 levels off the exact
coverage at the outer rim and 32 at the inner rim, where it was 54 and 61;
at 1:1 it is 30 and 29, where it was 64 and 58. Curve ends at corners,
lines and short curves stay on the curve. Outlines are cached per zoom
level as before, with refined and plain outlines kept apart.
Raster exports draw the same refined edges as the canvas. Fills, narrower
strokes, strokes with a width profile, strokes in an unevenly scaled view
and vector exports are unchanged.
Tests: render::tests::curvedstrokeedges and
longstroke::a_long_wide_curved_stroke_draws_the_same_pixels_outlined_near_the_view.
The decoding File › Open, Place and the renderer share moves to
vectorcraft-doc (decode.rs: decode_image, decoded_layout), and SVG
import's images read through it: the size from the header against the
allowance first, then the pixels as stored with the profile the file
embeds (a TIFF's still read by the TIFF reader).
decoded_pixels_are_those_the_image_crate_read compares PNG, GIF, WebP,
TIFF and BMP at each depth the image crate writes with its pixels, and
JPEG within two steps.
The raster path tells formats with craft-image-codecs' detect, reads the
size from the header (vectorcraft-doc's header_size, the renderer's
decoded_layout, a Targa's own header) and decodes with the renderer's
decode_image, the pixels as stored, with the profile the file embeds.
The size notes Open, Place and the Links panel give, and Glass's Load
Texture, read the same way.
opened_rasters_are_the_pixels_the_image_crate_read compares BMP, TGA and
TIFF at 8 and 16 bits, gray and color, with and without alpha, with the
image crate's pixels, and PNG, JPEG, GIF and WebP stored as they are.
The renderer's image paint reads sizes from the header (vectorcraft-doc's
header_size, craft-image-codecs' inspect_raster) and decodes through
craft-image-codecs, the pixels as stored, for the formats it drew
before (PNG, JPEG, GIF, WebP, TIFF and BMP). A test compares the pixels
with the image crate's for each PNG color type and depth, palettes and
1-bit gray, GIF, WebP, TIFF, BMP and JPEG.
The JPEG writer goes back to main's jpeg-encoder one: the craft-image-codecs
version wrote a CMYK JPEG's resolution in a little-endian EXIF of another
layout, failing the tests of main's #3084 fix. TIFF LZW strips stay on
craft-stream-codecs, checked against weezl (now a dev-dependency): read
back the same and never larger.