mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-27 03:34:23 +00:00
Effects: Outline Object on an image's fill or stroke follows its opaque pixels
An image's own fill or stroke with Outline Object now follows the outline of the image's pixels that are at least 50% opaque, traced from the alpha and fitted with curves, instead of the image's frame. An image without transparency, one whose pixels can't be read, one of more than 64 megapixels or whose decoded pixels take more than 256 MB, and one whose outline would need more than 100,000 anchor points keep the frame. An image with no pixel at least half opaque gives nothing to paint. Images of more than 4 megapixels are traced from their alpha averaged down to 4 megapixels, and an averaged pixel that covers a pixel at least half opaque stays at least half opaque, so thin opaque lines stay in the outline. Each outline is traced once for its pixels, kept for the next redraw while those pixels are loaded, and dropped after them; a second thread that needs the same outline waits for the trace. - vectorcraft-trace: `decode_alpha` reads an image's alpha, and `opaque_outline` traces it as Black and White mode at threshold 128. - vectorcraft-effects: the reshaped image art uses it for rows whose first effect is Outline Object; Convert to Shape rows keep the frame. - Docs: docs/mcp.md, the Outline Object params text and an evidence line in docs/target-app-parity.md. docs/mcp.md also says that Use Preview Bounds takes in the shapes an image's fills and strokes paint.
This commit is contained in:
+15
-6
@@ -3443,12 +3443,21 @@ the fill or stroke paints, and SVG, PDF, EPS and the other vector exports write
|
||||
holds inline graphics, those effects are drawn and exported only when the type has a geometry effect or perspective
|
||||
of its own.
|
||||
An image's own fills and strokes draw only when they carry a visible Convert to Shape or Outline Object effect: Convert
|
||||
to Shape sizes its shape from the image's box, Outline Object gives the image's frame, the effects after it reshape
|
||||
that shape, and the effects before it are left out. Its Contents row stands for the image; `appearance.addFill` and
|
||||
`appearance.addStroke` put a new item right below that row, so it paints under the image. SVG, PDF, EPS and the other
|
||||
vector exports write those items as paths, and `effect.expandAppearance` turns them into objects in a group with the
|
||||
image.
|
||||
Use Preview Bounds measures an image by its frame.
|
||||
to Shape sizes its shape from the image's box, Outline Object gives the outline of the image's opaque area, the
|
||||
effects after it reshape that shape, and the effects before it are left out. The opaque area is the pixels whose alpha
|
||||
is at least 50%. Its outline is traced as Image Trace's Black and White mode traces at threshold 128 (Paths and
|
||||
Corners at their defaults, no area left out as noise): the edge follows anti-aliased edges to a fraction of a pixel
|
||||
and is fitted with curves. Outline Object gives the image's frame when the image has no transparency (a format
|
||||
without alpha, or every pixel at least half opaque), when its pixels can't be read, when the outline would take more
|
||||
than 100,000 anchor points, and when the image has more than 64 megapixels or its decoded pixels take more than 256 MB
|
||||
(a 16-bit image of more than 32 megapixels). An image with no pixel at least half opaque gives nothing to paint. An
|
||||
image of more than 4 megapixels is traced with its alpha averaged down to 4 megapixels; an averaged pixel that covers a
|
||||
pixel at least half opaque counts as at least half opaque, so opaque lines thinner than the reduction stay in the outline. The
|
||||
outline is traced the first time it is needed and kept while the image's pixels are loaded. These are VectorCraft's
|
||||
own rules. The image's Contents row stands for the image; `appearance.addFill` and `appearance.addStroke` put a new
|
||||
item right below that row, so it paints under the image. SVG, PDF, EPS and the other vector exports write those items
|
||||
as paths, and `effect.expandAppearance` turns them into objects in a group with the image.
|
||||
Use Preview Bounds measures an image by its frame and the shapes its own fills and strokes paint.
|
||||
|
||||
```json
|
||||
{"name":"run_command","arguments":{"command":"appearance.addFill","params":{"ids":[7]}}}
|
||||
|
||||
@@ -1370,6 +1370,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
Fill and stroke paint (Fill, Stroke, None, Apply Last Color and Apply Last Gradient, also on characters selected with the Type tool), the Stroke panel's options, gradient and freeform point edits, Swap Fill and Stroke, Default Fill and Stroke, the Eyedropper, and the Appearance panel's item edits, Clear Appearance, Reduce to Basic Appearance, Remove Item, item reordering and Move Appearance record no undo step when they change nothing.
|
||||
The Add New Effect popup (Appearance panel, Properties), the Appearance panel's swatch picker, the Gradient panel's gradient swatches menu and the Image Trace button's list of presets stop at the bottom of a short window, and the mouse wheel or the scroll bar reaches their last rows. A list that fits does not scroll (`a_long_swatch_picker_scrolls_inside_a_short_window`).
|
||||
An image's own fills and strokes draw the shape that a Convert to Shape or Outline Object effect on them gives them (the image's box or its frame, reshaped by the effects after it), under or over the image as its Contents row says, on the canvas, in exports and through Expand Appearance; new fills and strokes on an image go under it. Without one of those effects they draw nothing, and Use Preview Bounds measures an image by its frame.
|
||||
Outline Object on an image's own fill or stroke follows the outline of the image's opaque area, and the image's frame when the image has no transparency. Path effects apply to a fill or stroke added to a bitmap object ([archived reference manual, page 561](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=561)), and with Outline Object such a stroke follows the boundary of the art when the image has transparent areas and the image's frame when it has none ([CreativePro article on strokes for placed images](https://web.archive.org/web/20250815214529/https://creativepro.com/add-strokes-placed-images-illustrator/)). VectorCraft's own rules: the opaque area is the pixels at least 50% opaque, and its outline is traced as Image Trace's Black and White mode traces at threshold 128 and fitted with curves. Evidence: `tests::imageoutline` (vectorcraft-effects), `opaque::tests` (vectorcraft-trace), `tests::containers::an_images_stroke_with_outline_object_follows_its_opaque_area` (vectorcraft-engine).
|
||||
A geometry effect on one of type's own fills or strokes reshapes the whole outline that the fill or stroke paints, on the canvas and in exports; PDF, SVG, EPS and the other vector exports write such type as paths. On type that holds inline graphics, those effects are drawn and exported only when the type has a geometry effect or perspective of its own.
|
||||
The Appearance panel's inline effect editor labels each parameter as the effect dialogs' generic fields do, without the colon ("Max. Radius", "Channel 1", "Create New Fields by"). Roughen's and Zig Zag's Points, Offset Path's Joins, Inner Glow's Source and the menus of Radial Blur, Smart Blur, Sprayed Strokes, Glass, Mezzotint, Halftone Pattern, Grain, Texturizer and De-Interlace are dropdowns with the dialog's labels that send the dialog's values, and a plug-in's choice is a dropdown of the plug-in's values.
|
||||
Revolve's edge, Extrude & Bevel's bevel, every Warp style's orientation, Rasterize's Color Model, Background and Anti-aliasing and the channel of Levels and Curves are dropdowns too, with the labels their own dialogs show. `effect.apply` and `effect.setParams` refuse a Levels or Curves `channel` other than `rgb`, `red`, `green` or `blue` (or `r`, `g` and `b`, in any letter case).
|
||||
|
||||
Reference in New Issue
Block a user