Merge pull request #7051 from dotCooCoo/feat/concept-to-vector-providers

Concept to Vector: offline Image Trace styles behind a provider boundary
This commit is contained in:
.CooCoo authored and GitHub committed 2026-12-05 03:57:28 -08:00
commit 37dd394ea9
36 files changed
+5104 -87

No files matched your search

+6 -2
View File
@@ -1014,9 +1014,13 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi
## G18 Generative AI features
- **Done:** Concept to Vector in part: Window › Concept to Vector makes 1 to 5 styles of one selected image
side by side and inserts the ticked ones beside it as one undo step (`conceptVector.*`). Providers plug in
by id (`crates/engine/src/concept_vector.rs`), and a request to any provider makes up to 8 variations; the
only provider is built in and makes five offline Image Trace styles.
- **Missing:** Text to Vector Graphic, Generative Recolor, Generative Shape Fill (#766), Generative Expand,
Concept to Vector, Prompt to Edit, Rewrite Text. Adobe's run on its cloud models; ours would be a pluggable
provider.
Concept to Vector's prompt-led generation and raster output, Prompt to Edit, Rewrite Text. In the reference
app these run on cloud models; ours would be a pluggable provider.
- **Needs:** an owner decision on models and providers.
- **Estimate:** 30–60 h after that decision.
+51 -1
View File
@@ -7013,6 +7013,55 @@ already walks Image Trace. Short agent entry points:
nothing, and a built-in preset's name, `Custom` or another saved preset's name keeps the editor open. Delete selects
the saved preset below the deleted one, else the one above it, else Default. Import… asks whether to replace saved presets whose names the file holds (Cancel
keeps them), and Export… writes every saved preset.
- Concept to Vector: `conceptVector.providers` lists the providers that `conceptVector.generate` can call by id, with
their styles. The built-in `offline.traceStyles` makes the styles `outline`, `inkLines`, `flatColor`, `detailedColor`
and `grayTones` with Image Trace on this computer; it takes no prompt and makes vector art only. A provider is used
only when it is named: an unknown one is an error, and so is one that takes no image, makes no vector art, or does
not support a non-empty `prompt`, each with that reason; no other provider is used in its place. Results are vector
art, so `output` other than `"vector"` is an error for every provider. `flatColor` traces abutting fills and lays
seam fills under them, as Image Trace's Abutting method with Fills does, when they fit within the limits below.
`conceptVector.generate {id?, provider, styles: [style id…], detail?: 0-100, prompt?, output?: "vector"}` makes one
variation of the image (or unexpanded Image Trace object) for each of 1 to 8 different styles and keeps them as a job of
the session; it does not change the document and is not journaled. A source that is locked or hidden, itself or by a
layer or group around it, or that is on a locked artboard, is refused. Results are
checked whatever provider made them: one variation per style in the order asked, every point finite and near the
image, every subpath with an anchor point, at most 250,000 paths (each subpath of a compound path counted as one)
and 1,000,000 anchor points in all. The reply lists each variation's `style`, `label`,
`paths`, `anchors`, `bounds` in the image's pixels and `warnings` (for example that a large image was traced scaled
down to 16 megapixels). `conceptVector.results {job}` returns the job again, and `conceptVector.cancel {job}` drops
its variations. The session keeps the 4 newest jobs until their document closes. A `conceptVector.generate` in a
script stops when the script is asked to stop, and keeps no job. A script that ends with an error,
like a batch, leaves the jobs as they were: the jobs it made are dropped, and a job it canceled, or whose document it
closed, is kept.
`conceptVector.insert {job, variations: [style id…]}` puts a group of each chosen variation, named after its style and
in the provider's order, to the right of the image, each the image's size with 24 pt between them, moved further
right past other visible art, also where a variation reaches past its image-sized box (the next one then starts 24
pt past what it paints); it is one undo step and selects the groups. A variation with no paths is left out, and when
every chosen one has none, nothing changes (no undo step, `ids` empty). The groups go above the outermost clip group or
opacity-masked group around the image, so that it does not hide them, and above the outermost envelope, blend,
repeat or other live object, the outermost group whose members it makes or places (a graph, an Objects on Path,
Shaper, dimension, flare or Live Paint group, a compound shape), and the outermost group with effects or fills and strokes of its
own, around it, whose content stays as it is. It is an error when the job was canceled or dropped, when its document
is not the active one, when the object, its pixels or its placement changed, when the object is now locked or hidden,
or when it is on a layer with a clipping mask, an opacity mask, or effects, fills or strokes of its own, or when the
object or a group around it has effects that move or reshape it (Transform, a warp), which show the image away from
its placement, or when its image is distorted (Perspective Distort or Free Distort) and drawn at its corners instead
of by its transform. Jobs are not saved, so an insert or a cancel played from recorded steps (an action, a journal played
again, or a step of a batch played again) is an error too. Example, where insert takes the `job`
that generate returned (job numbers count up through the session, so 1 only for its first job):
```json
{"command": "conceptVector.generate", "params": {"provider": "offline.traceStyles", "styles": ["outline", "flatColor"], "detail": 60}}
{"command": "conceptVector.insert", "params": {"job": 1, "variations": ["flatColor"]}}
```
In the app, `ui.conceptVector` opens the Concept to Vector panel, which runs the same commands; Generate shows a progress bar
and Cancel. On the desktop it runs off the UI thread unless `VECTORCRAFT_SYNC_OPEN` is set, in which case it runs at
once on the UI thread; the web build runs it on the UI thread one part a frame, and
Cancel takes effect before the next part. `ui.conceptVector.generate` does what Generate does and returns
`{running: true}` while the styles are made, else `{running: false, job}`; `ui.conceptVector.cancel` does what Cancel
does. A Generate after a Cancel starts once the canceled run's thread has ended. The panel shows a job's results only
while the document it was made in is the active one, and a preview that leaves part of its variation out says so.
- Live Paint: `livePaint.make`, `livePaint.merge`, `livePaint.fill {group?, point}`, `livePaint.strokeEdge`,
`livePaint.info {group?|id?}`, `livePaint.release`, `livePaint.expand`, and `livePaint.gapOptions {ids?, detect?, size?,
color?, closeGaps?}` (Object › Live Paint › Gap Options). Make gives each covered face the fill rows that draw of
@@ -11832,7 +11881,8 @@ be one of …", and a `visible` that is not true or false fails with "`visible`
every group as it is. The groups and their contents are VectorCraft's own.
`window.taskBar.actions {action, visible?}` (desktop app) turns one of the Contextual Task Bar's actions or chips on
(`visible: true`), off (`false`) or toggles it (omitted or null), and returns `{action, visible}`. The actions are `imageTrace`,
`cropImage`, `removeBackground`, `removeAnchorPoints`, `join` (Connect and Join), `cutPath`, `convertToCorner`,
`cropImage`, `removeBackground`, `conceptToVector` (Concept to Vector), `removeAnchorPoints`,
`join` (Connect and Join), `cutPath`, `convertToCorner`,
`convertToSmooth`, `group`, `makeClippingMask`, `unite`, `expand`, `editClippingPath`, `releaseClippingMask`,
`ungroup`, `isolate`, `editPath`, `releaseCompoundPath`, `createOutlines`, `convertToPointType`, `convertToAreaType`,
`typeOnPathOptions`, `centerOnTop`, `centerOnBottom`, `dynamicText`, `offsetPath`, `simplify`, `smooth`, `duplicate`,
+1
View File
@@ -2055,6 +2055,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
- **Image Trace, JPEG blocks:** Color, Grayscale and Black and White traces smooth the edges of a JPEG's 8 × 8 blocks before tracing, so a dark ground whose tone changes slowly is no longer traced as staircases along the block edges. The block grid is found in the image itself: the mean step between neighboring pixels must peak at one position in eight, across and down. A cropped JPEG and a JPEG saved in another format are smoothed too. A picture of flat 8 × 8 cells is left as it is, and art made of 8 × 8 cells with slight texture inside each cell is smoothed as a JPEG copy would be. A small step at a block edge, with no edge in the eight pixels around it, is spread over those eight pixels, and larger steps are kept, as the deblocking filters of ITU-T H.263 Annex J and MPEG-4 Part 2 Annex F.3.1 do. Black and White smooths only the smallest steps, and traces of more than 16 colors move every row of a stretch of eight by the same amount (VectorCraft's own rule and values). On a 4000 × 3000 photo saved as JPEG, the straight outline segments that lie on the block grid fall from 52% and 51% (across and down) to 24% and 29% at 16 Colors, and from 54% and 51% to 43% and 42% at High Fidelity Photo; staircase runs fall from 83 to 67 (16 Colors), 11 to 1 (6 Colors), 30 to 13 (Black and White Logo) and 428 to 403 (High Fidelity Photo). A 600 px photo saved as a quality-40 JPEG has 4 staircase runs instead of 2 at 16 Colors. Images without a block grid trace as before. Tests: `tests::a_jpegs_blocks_are_not_traced_as_steps`, `deblock::tests`. Scores and hours unchanged.
- **Image Trace, Document Library color groups:** with Document Swatches, the panel's Colors menu and `"colorGroup"` trace with one color group's colors instead of every swatch, as the public panel documentation describes Document Library; code-drawn tests in `crates/engine` and the panel.
- **Image Trace, Document Library colors:** with Document Swatches, traced fills and strokes use the displayed colors of process, global, spot and tint swatches without links, so editing a swatch leaves the trace unchanged; swatch-library colors are also unlinked; code-drawn tests in `crates/engine`.
- **Concept to Vector, offline styles (in part):** Window › Concept to Vector and Object › Concept to Vector… (also the context menu and the contextual task bar for one image or unexpanded Image Trace object; the Control bar and Properties for one image) make 1 to 5 styles of the selected image side by side (a request to any provider makes up to 8 variations, one per selected style) and insert the ticked ones to the right of it as one undo step (beside any group that makes or places its members, such as a graph, Objects on Path or Live Paint group, and never on a layer with effects, fills or strokes of its own; the previews show only while their document is the active one), as the help page describes for comparing styles ([Generate vector artwork from images](https://helpx.adobe.com/illustrator/desktop/use-generative-ai/generate-vector-artwork-from-images.html)). The only provider is built in: five VectorCraft styles (Outline, Ink Lines, Flat Color, Detailed Color, Gray Tones) made with Image Trace on this computer, with Detail from 0 to 100; it takes no prompt and makes no raster output, so prompt-led generation is still missing. Other providers plug in by id through `crates/engine/src/concept_vector.rs`, and every result is checked before it is kept. `ui.conceptVector.generate` and `ui.conceptVector.cancel` do what the panel's Generate and Cancel do. Tests: `concept_vector::tests` in `crates/engine` and `panels::concept_vector::tests` in `crates/ui-egui`. Scores and hours unchanged.
- **Image Trace, flattened slivers:** in a Color, Grayscale or Black and White trace with Fills, a traced region whose outline straightens onto one line (a single pixel, or a one-pixel row along an edge, its pieces shared with the regions beside it) is left out instead of becoming a selectable path with no area, which paints nothing. Snap Curves To Lines straightens more outlines, so it leaves out more of these. Without Fills, the region's 1 px stroke draws it, and it is kept. Code-drawn tests in `crates/trace`.
- **Image Trace, Abutting seam fills:** an Abutting trace with Fills holds a `Seam Fills` clip group under its paths, with strokes along the edges two filled paths share, in the lower path's color, 1.5 image pixels wide (VectorCraft's own width) and clipped to the image's box within the traced paths' box; on an image stretched more one way than another, each stroke's outline in image pixels is a filled path instead. The paths and their shared edges are unchanged. Tests: `seam::tests` in `crates/trace`, `image_trace_abutting_seam_fills_sit_under_the_paths` and `image_trace_seam_fills_on_a_stretched_image_stay_near_their_edge` in `crates/engine`.
- **Image Trace, Auto Color rare colours:** the Automatic palette keeps colours too rare for its area count when they are distinct (Oklab) and drawn as coherent regions, at most six, protected from mixed-colour merging and Noise; code-drawn stem, highlight, low-contrast and scattered-noise tests (see [quality notes](image-trace-quality.md#auto-color-keeps-rare-colours)).
+1
View File
@@ -508,6 +508,7 @@ next unit in the order a right-click on a ruler lists them, from Feet back to Po
| Image Trace panel: Ignore Color has a canvas eyedropper beside its color picker | done | #8068. Samples original pixels of the selected placed image or the retained source of a live trace without changing the displayed canvas View. The existing color picker remains available. Preview off keeps a draft; Preview on retraces a live trace as one undo step. An outside or transparent miss leaves the pick armed; a valid sample or Escape restores the previous tool, and changing the target or explicitly choosing a tool cancels. Paint defaults and selection are retained. `tests/image_trace_ignore_sampler.rs`; no algorithm parity claim. Sampler-owned release/Zoom regression source uses the native canvas and covers ordinary navigation, dock rejection, accepted sampling, unchanged non-view state and no idle replay (#8744; runtime pending). | unknown |
| Live trace result bounds and selection highlights exclude the retained bitmap; source-image views retain it | done | All TraceView modes and rotated result bounds regression-covered; ordinary hidden group behavior retained | unknown |
| Image Trace panel: the Preview checkbox before Trace chooses whether a setting change traces the selected Image Trace object again at once | done | Per the public documentation, Preview shows the result of the current settings and Trace traces with them (<https://web.archive.org/web/20250831090623/https://helpx.adobe.com/illustrator/using/image-trace.html>). Preview is on by default and kept with the UI preferences; Reset to Default leaves it. Off, changes wait in the panel until Trace applies them as one undo step, or until Preview is turned on again. Changes stay with the object they were made for while another object is selected, and come back when it is selected again. `imageTrace.preview {on?}`, `ui.set {imageTracePreview}`; `panels/image_trace.rs` headless tests (`with_preview_off_a_slider_change_waits_for_trace`, `turning_preview_on_traces_the_changes_that_waited`, `preview_turned_on_with_nothing_selected_traces_when_the_object_is_selected_again`, `settings_that_wait_stay_with_their_object`, `settings_that_wait_come_back_when_their_object_is_selected_again`, `settings_that_wait_are_dropped_when_their_object_changed_since`, `preview_is_kept_with_the_preferences_and_reset_to_default_leaves_it`) | unknown |
| Concept to Vector panel: Window › Concept to Vector and Object › Concept to Vector… (also the context menu and the Contextual Task Bar) open it for one image or unexpanded Image Trace object, and the Control bar and Properties' Quick Actions for one image; it makes 1 to 5 styles side by side (a request to any provider makes up to 8 variations, one per selected style) and Insert Selected puts the ticked ones to the right of the image as one undo step | partial | The help page describes choosing up to 8 styles of the selected image to compare side by side (<https://helpx.adobe.com/illustrator/desktop/use-generative-ai/generate-vector-artwork-from-images.html>). The built-in provider makes five offline Image Trace styles with Detail 0 to 100; its prompt field is disabled and it makes no raster output. On the web build a run is made one part a frame, so Cancel takes effect inside a style. Decoding the image, finding a style's color layers and tracing one layer are each one part; the Detailed Color and Gray Tones styles trace all their color layers in one part. Cancel waits for the part in progress to end. `conceptVector.providers`, `conceptVector.generate`, `conceptVector.results`, `conceptVector.cancel`, `conceptVector.insert`, `ui.conceptVector.cancel` (the panel's Cancel); `panels/concept_vector.rs` headless tests | unknown |
| Toolbar without group labels by default, one or two columns; All Tools drawer by flyout group with shortcuts, its menu (Reset, Basic, Advanced) and Show section | done | #1751; a preference brings the labels back; `toolbar.show` sets the Fill/Stroke, Coloring, Draw Mode and Screen Mode controls; Window > Toolbars > Compact Tools adds optional denser spacing for the main Tools panel while retaining the existing default (#7234) | unknown |
| Actions panel: ≡ › Save Actions… saves the current set with all its actions to a file and ≡ › Load Actions… adds a saved set ([Manage a set of actions](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/manage-a-set-of-actions.html)) | done | `ui.actionSet.save`, `ui.actionSet.load`; `panels/actions.rs` tests. The file is VectorCraft's own `.vcactions` JSON | unknown |
| Actions panel: ≡ › Replace Actions… puts the set of a saved file in place of every set in the panel ([the help page](https://helpx.adobe.com/illustrator/desktop/automate-visualize-data/automate-actions/actions-panel-overview.html)) | done | `ui.actionSet.replace`; `panels/actions.rs` tests. The file is read as Load Actions… reads it; the item asks no question first | unknown |