Image Trace: buttons above the Preset menu choose the Auto Color, High Color, Low Color, Grayscale, Black and White and Outline presets

Six buttons above the Image Trace panel's Preset dropdown choose a preset as the dropdown does:
Auto Color chooses Auto Color, High Color chooses High Fidelity Photo, Low Color chooses Low
Fidelity Photo, Grayscale chooses Shades of Gray, Black and White chooses Black and White Logo,
and Outline chooses Outline. With Preview on, a click traces the selected Image Trace object again
as one undo step; with nothing traced selected, it changes the panel's settings only. The button of
the panel's preset shows as selected, and its tooltip names the preset.

The help page lists these options before Preset:
https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/image-trace-panel-options.html
Which preset each button chooses is VectorCraft's own.

High Color and Low Color get rows in every catalog.
This commit is contained in:
dotCooCoo
2026-11-08 12:47:56 +07:00
committed by bflatastic
parent 12da9ef677
commit 8d3a64453a
30 changed files with 192 additions and 0 deletions
+2
View File
@@ -1331,6 +1331,8 @@ font-technology Variable Променливи
Grays Сиви
Grays and Neutrals Сиви и неутрални
Grayscale Черно-бяло
High Color Много цветове
Low Color Малко цветове
Grayscale images Черно-бели изображения
Greek & Cyrillic Гръцки и кирилица
Green Зелено
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -3829,6 +3829,8 @@ axis Both Obje
Center Sredina
Transform in Perspective Transformiši u perspektivi
Grayscale Nijanse sive
High Color Mnogo boja
Low Color Malo boja
Embed Ugradi
Star Zvijezda
Power Saving (integrated) Ušteda energije (integrisana)
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -1778,6 +1778,8 @@ digits Malayalam Malaiàlam
Grays Grisos
Grays and Neutrals Grisos i neutres
Grayscale Escala de grisos
High Color Molts colors
Low Color Pocs colors
Grayscale images Imatges en escala de grisos
Greek & Cyrillic Grec i ciríl·lic
Green Verd
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -3870,6 +3870,8 @@ axis Both Obě
Center Střed
Transform in Perspective Transformovat v perspektivě
Grayscale Stupně šedi
High Color Mnoho barev
Low Color Málo barev
Embed Vložit
Star Hvězda
Power Saving (integrated) Úsporný režim (integrovaná)
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -3598,6 +3598,8 @@ axis Both Begge
Center Midt
Transform in Perspective Transformer i perspektiv
Grayscale Gråtoner
High Color Mange farver
Low Color Få farver
Embed Integrér
Star Stjerne
Power Saving (integrated) Strømbesparende (integreret)
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -1362,6 +1362,8 @@ file-filter Templates Vorlagen
Grays Grautöne
Grays and Neutrals Grautöne und neutrale Farben
Grayscale Graustufen
High Color Viele Farben
Low Color Wenige Farben
Grayscale images Graustufenbilder
Greek & Cyrillic Griechisch und Kyrillisch
Green Grün
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -1301,6 +1301,8 @@ font-technology Variable Μεταβλητές
Grays Γκρι τόνοι
Grays and Neutrals Γκρι και ουδέτεροι τόνοι
Grayscale Κλίμακα του γκρι
High Color Πολλά χρώματα
Low Color Λίγα χρώματα
Grayscale images Εικόνες σε κλίμακα του γκρι
Greek & Cyrillic Ελληνικά και κυριλλικά
Green Πράσινο
Can't render this file because it contains an unexpected character in line 163 and column 5.
+2
View File
@@ -1380,6 +1380,8 @@ font-technology Variable Variables
Grays Grises
Grays and Neutrals Grises y neutros
Grayscale Escala de grises
High Color Muchos colores
Low Color Pocos colores
Grayscale images Imágenes en escala de grises
Greek & Cyrillic Griego y cirílico
Green Verde
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -3794,6 +3794,8 @@ axis Both Molemmat
Center Keskitä
Transform in Perspective Muunna perspektiivissä
Grayscale Harmaasävy
High Color Paljon värejä
Low Color Vähän värejä
Embed Upota
Star Tähti
Power Saving (integrated) Virransäästö (integroitu)
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -1374,6 +1374,8 @@ font-technology Variable Variables
Grays Gris
Grays and Neutrals Gris et neutres
Grayscale Niveaux de gris
High Color Beaucoup de couleurs
Low Color Peu de couleurs
Grayscale images Images en niveaux de gris
Greek & Cyrillic Grec et cyrillique
Green Vert
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -1971,6 +1971,8 @@
Grays ग्रे
Grays and Neutrals ग्रे और तटस्थ
Grayscale ग्रेस्केल
High Color अधिक रंग
Low Color कम रंग
Grayscale images ग्रेस्केल इमेज
Grayscale Images ग्रे स्केल इमेज
Greek & Cyrillic ग्रीक & Cyrillic
Can't render this file because it is too large.
+2
View File
@@ -1749,6 +1749,8 @@ file-filter Templates Sablonok
Grays Szürkék
Grays and Neutrals Szürkék és semleges színek
Grayscale Szürkeárnyalatos
High Color Sok szín
Low Color Kevés szín
Grayscale images Szürkeárnyalatos képek
Greek & Cyrillic Görög és cirill
Green Zöld
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -3598,6 +3598,8 @@ axis Both Keduanya
Center Tengah
Transform in Perspective Transformasi dalam perspektif
Grayscale Skala abu-abu
High Color Banyak warna
Low Color Sedikit warna
Embed Sematkan
Star Bintang
Power Saving (integrated) Hemat daya (terintegrasi)
Can't render this file because it contains an unexpected character in line 2246 and column 5.
+2
View File
@@ -1392,6 +1392,8 @@ file-filter Templates Modelli
Grays Grigi
Grays and Neutrals Grigi e neutri
Grayscale Scala di grigi
High Color Molti colori
Low Color Pochi colori
Grayscale images Immagini in scala di grigi
Greek & Cyrillic Greco e cirillico
Green Verde
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -1731,6 +1731,8 @@ digits Malayalam マラヤーラム数字
Graphics: {adapter} グラフィックス: {adapter}
Grays グレー
Grayscale グレースケール
High Color 多色
Low Color 少色
Flat Logo フラットロゴ
Grayscale images グレースケールイメージ
Green グリーン
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -3393,6 +3393,8 @@ axis Both ორივე
Center ცენტრში
Transform in Perspective პერსპექტივაში გარდაქმნა
Grayscale ნაცრისფერი გრადაციები
High Color ბევრი ფერი
Low Color ცოტა ფერი
Embed ჩაშენება
Star ვარსკვლავი
Power Saving (integrated) ენერგიის დაზოგვა (ინტეგრირებული)
Can't render this file because it is too large.
+2
View File
@@ -1721,6 +1721,8 @@ digits Malayalam 말라얄람어
Graphics: {adapter} 그래픽: {adapter}
Grays 회색 계열
Grayscale 그레이스케일
High Color 많은 색상
Low Color 적은 색상
Flat Logo 단색 로고
Grayscale images 그레이스케일 이미지
Green 녹색
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -3612,6 +3612,8 @@ axis Both Beide
Center Midden
Transform in Perspective In perspectief transformeren
Grayscale Grijswaarden
High Color Veel kleuren
Low Color Weinig kleuren
Embed Insluiten
Star Ster
Power Saving (integrated) Energiebesparend (geïntegreerd)
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -3713,6 +3713,8 @@ axis Both Obie
Center Środek
Transform in Perspective Przekształć w perspektywie
Grayscale Skala szarości
High Color Wiele kolorów
Low Color Mało kolorów
Embed Osadź
Star Gwiazda
Power Saving (integrated) Oszczędzanie energii (zintegrowany)
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -1207,6 +1207,8 @@
Grays Cinzas
Grays and Neutrals Cinzas e Neutros
Grayscale Escala de Cinza
High Color Muitas Cores
Low Color Poucas Cores
Grayscale images Imagens em escala de cinza
Green Verde
Grid Grade
Can't render this file because it contains an unexpected character in line 6 and column 47.
+2
View File
@@ -1389,6 +1389,8 @@ file-filter Templates Шаблоны
Grays Серые
Grays and Neutrals Серые и нейтральные
Grayscale Оттенки серого
High Color Много цветов
Low Color Мало цветов
Grayscale images Изображения в оттенках серого
Greek & Cyrillic Греческий и кириллица
Green Зелёный
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -1339,6 +1339,8 @@ font-technology Variable Variabla
Grays Gråtoner
Grays and Neutrals Gråtoner och neutrala toner
Grayscale Gråskala
High Color Många färger
Low Color Få färger
Grayscale images Gråskalebilder
Greek & Cyrillic Grekiska och kyrilliska
Green Grön
Can't render this file because it contains an unexpected character in line 5 and column 25.
+2
View File
@@ -1303,6 +1303,8 @@ font-technology Variable Değişken
Grays Griler
Grays and Neutrals Griler ve Nötrler
Grayscale Gri tonlamalı
High Color Çok Renk
Low Color Az Renk
Grayscale images Gri tonlamalı görüntüler
Greek & Cyrillic Yunanca ve Kiril
Green Yeşil
Can't render this file because it contains an unexpected character in line 5 and column 25.
+2
View File
@@ -1386,6 +1386,8 @@ file-filter Templates Шаблони
Grays Сірі
Grays and Neutrals Сірі та нейтральні
Grayscale Відтінки сірого
High Color Багато кольорів
Low Color Мало кольорів
Grayscale images Зображення у відтінках сірого
Greek & Cyrillic Грецька та кирилиця
Green Зелений
Can't render this file because it contains an unexpected character in line 177 and column 5.
+2
View File
@@ -1599,6 +1599,8 @@ file-filter Templates Mẫu
Grays Các màu xám
Grays and Neutrals Xám và trung tính
Grayscale Thang xám
High Color Nhiều màu
Low Color Ít màu
Grayscale images Ảnh thang xám
Greek & Cyrillic Hy Lạp & Cyrillic
Green Xanh lá
Can't render this file because it contains an unexpected character in line 199 and column 5.
+2
View File
@@ -1328,6 +1328,8 @@ file-filter Templates 模板
Grays 灰度级数
Grays and Neutrals 灰色和中性色
Grayscale 灰度
High Color 多色
Low Color 少色
Flat Logo 扁平徽标
Grayscale images 灰度图像
Greek & Cyrillic 希腊文与西里尔文
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -1356,6 +1356,8 @@ file-filter Templates 範本
Grays 灰色
Grays and Neutrals 灰色與中性色
Grayscale 灰階
High Color 多色
Low Color 少色
Flat Logo 扁平標誌
Grayscale images 灰階影像
Greek & Cyrillic 希臘文與西里爾文
Can't render this file because it contains an unexpected character in line 6 and column 47.
+32
View File
@@ -270,6 +270,21 @@ fn preset_label(name: &str) -> &str {
crate::i18n::tr_ctx(crate::i18n::current(), "imageTrace", name)
}
/// The buttons above the Image Trace panel's Preset dropdown, in panel order: each one's name and the
/// built-in preset a click chooses. The help page lists these options before Preset
/// (<https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/image-trace-panel-options.html>);
/// which preset each one chooses is VectorCraft's own.
fn preset_buttons() -> [(&'static str, &'static str); 6] {
[
(preset_label("Auto Color"), "Auto Color"),
(tl!("High Color"), "High Fidelity Photo"),
(tl!("Low Color"), "Low Fidelity Photo"),
(tl!("Grayscale"), "Shades of Gray"),
(tl!("Black and White"), "Black and White Logo"),
(preset_label("Outline"), "Outline"),
]
}
fn preset_list(app: &mut VectorcraftApp, ui: &mut Ui, current: &str) -> Option<String> {
let mut chosen = None;
let list = presets(app, ui.ctx());
@@ -559,6 +574,23 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
let restored = sync_with_object(&mut st, stored, object, &all, &changes);
let mut retrace = false;
// A preset button chooses its preset as the Preset dropdown does; the button of the panel's
// preset shows as selected.
ui.horizontal_wrapped(|ui| {
for (label, name) in preset_buttons() {
let selected = st.preset == name;
if cfg!(test) {
ui.ctx().data_mut(|d| d.insert_temp(egui::Id::unique(("trace-preset-button", name)), selected));
}
if ui.add(egui::Button::selectable(selected, label)).on_hover_text(preset_label(name)).clicked()
&& let Some(p) = all.iter().find(|p| p.0 == name)
{
st.preset = name.to_string();
st.params = p.1.clone();
retrace = true;
}
}
});
ui.horizontal(|ui| {
widgets::dim_label(ui, tl!("Preset:"));
let manage = 24.0;
@@ -1217,6 +1217,111 @@ fn the_preset_list_is_read_once_for_each_change_of_the_saved_presets() {
assert_eq!((reads(), shown_preset(&ctx)), (start + 4, "D".to_string()));
}
/// Choose `preset` from the Preset dropdown, which shows `shown`.
fn choose_from_preset_menu(app: &mut VectorcraftApp, ctx: &egui::Context, shown: &str, preset: &str) {
let texts = frame(app, ctx, vec![]);
let combo = texts.iter().rfind(|(t, _)| t == shown).map(|(_, r)| r.center()).unwrap_or_else(|| panic!("no `{shown}` in {texts:?}"));
click_at(app, ctx, combo);
let texts = frame(app, ctx, vec![]);
let at = texts.iter().rfind(|(t, _)| t == preset).map(|(_, r)| r.center()).unwrap_or_else(|| panic!("no `{preset}` in {texts:?}"));
click_at(app, ctx, at);
}
/// Which preset buttons showed as selected at the last frame.
fn selected_preset_buttons(ctx: &egui::Context) -> Vec<&'static str> {
preset_buttons()
.into_iter()
.filter(|(_, name)| ctx.data(|d| d.get_temp::<bool>(egui::Id::unique(("trace-preset-button", *name)))) == Some(true))
.map(|(_, name)| name)
.collect()
}
#[test]
fn each_preset_button_traces_the_selected_object_again_with_its_preset() {
let mut app = traced_app_with_ink(100);
trace_and_open(&mut app, "Default");
let ctx = egui::Context::default();
crate::theme::install_fonts(&ctx);
frame(&mut app, &ctx, vec![]);
let undo = |app: &VectorcraftApp| app.session.active().unwrap().history.undo.len();
for (label, preset) in [
("Auto Color", "Auto Color"),
("High Color", "High Fidelity Photo"),
("Low Color", "Low Fidelity Photo"),
("Grayscale", "Shades of Gray"),
("Black and White", "Black and White Logo"),
("Outline", "Outline"),
] {
let steps = undo(&app);
click(&mut app, &ctx, label);
frame(&mut app, &ctx, vec![]);
assert_eq!(selected_trace(&app).unwrap().0, preset, "{label}");
assert_eq!(undo(&app), steps + 1, "{label} traces as one undo step");
let all = presets(&mut app, &ctx);
assert_eq!(target(&app).2.unwrap()["params"], find_preset(&all, preset).unwrap().1, "{label} traces with the preset's settings");
assert_eq!((shown_preset(&ctx), selected_preset_buttons(&ctx)), (preset.to_string(), vec![preset]), "{label}");
}
// Undo returns to the object's previous preset, and the buttons follow it.
app.run("edit.undo", json!({})).unwrap();
frame(&mut app, &ctx, vec![]);
frame(&mut app, &ctx, vec![]);
assert_eq!(selected_trace(&app).unwrap().0, "Black and White Logo");
assert_eq!(selected_preset_buttons(&ctx), ["Black and White Logo"]);
}
#[test]
fn the_selected_preset_button_follows_the_preset_menu() {
let mut app = traced_app_with_ink(100);
trace_and_open(&mut app, "Default");
let ctx = egui::Context::default();
crate::theme::install_fonts(&ctx);
frame(&mut app, &ctx, vec![]);
assert!(selected_preset_buttons(&ctx).is_empty(), "Default has no button");
choose_from_preset_menu(&mut app, &ctx, "Default", "Shades of Gray");
assert_eq!(selected_trace(&app).unwrap().0, "Shades of Gray");
assert_eq!(selected_preset_buttons(&ctx), ["Shades of Gray"]);
choose_from_preset_menu(&mut app, &ctx, "Shades of Gray", "6 Colors");
assert_eq!(selected_trace(&app).unwrap().0, "6 Colors");
assert!(selected_preset_buttons(&ctx).is_empty(), "6 Colors has no button");
// A changed setting makes the preset Custom, and no button shows as selected.
click(&mut app, &ctx, "Outline");
frame(&mut app, &ctx, vec![]);
assert_eq!(selected_preset_buttons(&ctx), ["Outline"]);
click(&mut app, &ctx, "Preview");
click(&mut app, &ctx, "Fills");
frame(&mut app, &ctx, vec![]);
assert_eq!(shown_preset(&ctx), "Custom");
assert!(selected_preset_buttons(&ctx).is_empty());
}
#[test]
fn a_preset_button_with_no_image_selected_changes_the_panel_settings_as_the_preset_menu_does() {
let blank = || {
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default());
app.run("file.new", json!({"width": 100, "height": 100})).unwrap();
app
};
let mut app = blank();
let ctx = egui::Context::default();
crate::theme::install_fonts(&ctx);
frame(&mut app, &ctx, vec![]);
let steps = app.session.active().unwrap().history.undo.len();
click(&mut app, &ctx, "High Color");
frame(&mut app, &ctx, vec![]);
let by_button: TraceUi = pstate(&ctx, "image-trace");
assert_eq!(app.session.active().unwrap().history.undo.len(), steps, "nothing is traced");
assert!(target(&app).2.is_none(), "no Image Trace object");
assert_eq!(selected_preset_buttons(&ctx), ["High Fidelity Photo"]);
let mut menu_app = blank();
let menu_ctx = egui::Context::default();
crate::theme::install_fonts(&menu_ctx);
choose_from_preset_menu(&mut menu_app, &menu_ctx, "Default", "High Fidelity Photo");
let by_menu: TraceUi = pstate(&menu_ctx, "image-trace");
assert_eq!(menu_app.session.active().unwrap().history.undo.len(), steps);
assert_eq!((by_button.preset, by_button.params), (by_menu.preset, by_menu.params));
}
#[test]
fn panel_and_menu_draw_headless() {
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default());
+1
View File
@@ -1071,6 +1071,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
- **Image Trace, Preview:** the Image Trace panel's Preview checkbox, before Trace, is on by default, and a setting change traces the selected Image Trace object again at once. 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. When Preview is turned on with that object not selected, the object is traced with its changes when it is selected again. Preview is kept with the UI preferences, and Reset to Default leaves it. The `imageTrace.preview` command turns it on or off.
- **Image Trace small contours:** closed fits too small to form an editable subpath retain their positioned outline, including holes. Source-generated island, hole/winding and stepped-region regressions cover Corners and Noise; defaults, parity scores and estimates are unchanged.
- **Image Trace, custom presets:** Manage Presets next to the Image Trace panel's Preset dropdown saves the panel's settings as a new preset under a name (Save as New Preset…) and renames or deletes the saved preset shown; built-in presets don't change. Saved presets are kept with the preferences and follow the built-in ones in the panel, Control bar and Properties preset lists. `imageTrace.presets.save` and `imageTrace.presets.delete` save, rename and delete them, `imageTrace.presets` lists them, and `imageTrace.make {preset}` traces with one by name.
- **Image Trace, preset buttons:** six buttons above the Image Trace panel's Preset dropdown choose a preset as the dropdown does, for the options the [help page](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/image-trace-panel-options.html) lists before Preset. The presets each button chooses are VectorCraft's own: Auto Color chooses Auto Color, High Color chooses High Fidelity Photo, Low Color chooses Low Fidelity Photo, Grayscale chooses Shades of Gray, Black and White chooses Black and White Logo, and Outline chooses Outline. With Preview on, a click traces the selected Image Trace object again as one undo step; with nothing traced selected, it changes the panel's settings only. The button of the panel's preset shows as selected.
- **Create Strokes baseline (2026-10-17, measured):** the ignored centre-lines class covers 23 exact code-drawn scenes in aa and hard variants, including junctions, crossings, fills meeting strokes and varying widths. [Baseline and metric definitions](image-trace-quality.md#centre-lines). Topology is recovered from emitted geometry; width-profile metrics remain unavailable. No behaviour change or score increase.
- **Image Trace, collapsed loops keep few segments:** a loop whose fit collapses to one cubic keeps the fewest segments that hold its area and course, so a higher Paths gives no fewer segments; a code-drawn Paths sweep in `crates/trace` (see [quality notes](image-trace-quality.md#collapsed-loops-keep-few-segments)).
- **Image Trace, stacked layers only under their own areas:** with Method Overlapping, a layer reaches under the colors above it only within the connected areas that hold its own color, so a shape that sits apart from a color is no longer written again, at the same bounds, in that color, and the edge of that color's layer no longer shows through that shape's anti-aliased rim. *Measured* by `crates/trace/tests/quality` on each preset's own inputs: High Fidelity Photo 121 paths to 69.6 with ΔE 1.74 to 1.72, Low Fidelity Photo 37.1 paths to 26.1. Code-drawn disc, square and line tests in `crates/trace`.