diff --git a/crates/engine/src/cmd/buildcmds.rs b/crates/engine/src/cmd/buildcmds.rs index b24b8671..05f1eab0 100644 --- a/crates/engine/src/cmd/buildcmds.rs +++ b/crates/engine/src/cmd/buildcmds.rs @@ -120,7 +120,7 @@ pub fn specs() -> Vec { "Make", ["Object", "Image Trace"], None, - "{id?: image or Image Trace group (default: selection), preset?: name (imageTrace.presets), params?: {mode: \"blackAndWhite\"|\"grayscale\"|\"color\"|\"logo\", threshold: 0-255, palette: \"limited\"|\"fullTone\"|\"automatic\"|\"documentLibrary\" (color mode; limited: the `colors` best colours, fullTone: as many as the tones need, more with colorDetail, automatic: flat art with its own colours, else fullTone, documentLibrary: at most `colors` of the library's colours, as they are), colors: 2-256, colorDetail: 0-100 (fullTone, automatic), library: \"document\" (the document's swatches) or a swatch library id or name (swatch.library.list; documentLibrary), paths: 0-100, corners: 0-100, noise: px, method: \"abutting\"|\"overlapping\", ignoreWhite, snapCurvesToLines, fills: true, strokes: false (Create: lines up to strokeWidth wide become stroked centre lines; without fills, wider areas become stroked outlines), strokeWidth: px (10), logoColors?: [\"#rrggbb\"…] (mode logo: flat-colour logos only; colours found automatically or named here, white is always its own colour, at most ten; noise = areas under noise/10 px ignored; edges to a fraction of a pixel, sharp corners restored, lines and circles snapped; enclosed transparent areas are painted white unless ignoreWhite makes them holes; fills/strokes are ignored; gradients and photos are refused)}, view?: as imageTrace.setView (default: the traced object's own, else tracingResult), ids?: [id…] (instead of id)} → {id, paths, anchors, colors}", + "{id?: image or Image Trace group (default: selection), preset?: name (imageTrace.presets), params?: {mode: \"blackAndWhite\"|\"grayscale\"|\"color\"|\"logo\", threshold: 0-255, palette: \"limited\"|\"fullTone\"|\"automatic\"|\"documentLibrary\" (color mode; limited: the `colors` best colours, fullTone: as many as the tones need, more with colorDetail, automatic: flat art with its own colours, else fullTone, documentLibrary: at most `colors` of the library's colours, as they are), colors: 2-256, colorDetail: 0-100 (fullTone, automatic), library: \"document\" (the document's swatches) or a swatch library id or name (swatch.library.list; documentLibrary), paths: 0-100, corners: 0-100, noise: px, method: \"abutting\"|\"overlapping\", ignoreWhite (leave out white areas), ignoreColor?: \"#rrggbb\" (with ignoreWhite: the colour left out instead of white), snapCurvesToLines, fills: true, strokes: false (Create: lines up to strokeWidth wide become stroked centre lines; without fills, wider areas become stroked outlines), strokeWidth: px (10), logoColors?: [\"#rrggbb\"…] (mode logo: flat-colour logos only; colours found automatically or named here, white is always its own colour, at most ten; noise = areas under noise/10 px ignored; edges to a fraction of a pixel, sharp corners restored, lines and circles snapped; enclosed transparent areas are painted white unless ignoreWhite makes them holes; fills/strokes are ignored; gradients and photos are refused)}, view?: as imageTrace.setView (default: the traced object's own, else tracingResult), ids?: [id…] (instead of id)} → {id, paths, anchors, colors}", has_selection_or_ids, |s, p| trace_make(s, p, false) ), diff --git a/crates/engine/src/tests_build.rs b/crates/engine/src/tests_build.rs index cfb194d9..911f5fda 100644 --- a/crates/engine/src/tests_build.rs +++ b/crates/engine/src/tests_build.rs @@ -795,7 +795,8 @@ fn image_trace_presets_query_and_errors() { let mut s = session(); let r = s.execute("imageTrace.presets", &json!({})).unwrap(); let names: Vec<&str> = r["presets"].as_array().unwrap().iter().map(|p| p["name"].as_str().unwrap()).collect(); - assert_eq!(names.len(), 13); + assert_eq!(names.len(), 15); + assert!(names.contains(&"Auto Color") && names.contains(&"Outline")); assert!(names.contains(&"Technical Drawing") && names.contains(&"Shades of Gray") && names.contains(&"Flat Logo")); let a = rect(&mut s, 0.0, 0.0, 10.0, 10.0); assert!(s.execute("imageTrace.make", &json!({"id": a.0})).is_err(), "not an image"); diff --git a/crates/trace/src/lib.rs b/crates/trace/src/lib.rs index 736f7fce..92cb1aed 100644 --- a/crates/trace/src/lib.rs +++ b/crates/trace/src/lib.rs @@ -269,8 +269,12 @@ pub struct TraceParams { /// `noise / 10` pixels of the source image.) pub noise: u32, pub method: Method, - /// Drop white areas (no white background shape). + /// Ignore Color: drop the areas of one colour (no background shape): white, unless + /// `ignore_color` names another. pub ignore_white: bool, + /// The colour Ignore Color leaves out (`#rrggbb`): the palette colours within about 30 levels + /// of it. `None` is white. (Flat Logo mode leaves out white only.) + pub ignore_color: Option, /// Replace nearly-straight curves with straight lines. In Logo mode this also snaps tight arcs /// to true circles. pub snap_curves_to_lines: bool, @@ -302,6 +306,7 @@ impl Default for TraceParams { noise: 25, method: Method::Abutting, ignore_white: false, + ignore_color: None, snap_curves_to_lines: false, fills: true, strokes: false, @@ -353,6 +358,7 @@ impl TraceParams { /// Built-in preset names in panel order (our own parameter sets). pub const PRESET_NAMES: &[&str] = &[ "Default", + "Auto Color", "High Fidelity Photo", "Low Fidelity Photo", "3 Colors", @@ -364,6 +370,7 @@ pub const PRESET_NAMES: &[&str] = &[ "Silhouettes", "Line Art", "Technical Drawing", + "Outline", "Flat Logo", ]; @@ -392,6 +399,10 @@ pub fn preset(name: &str) -> Option { }; Some(match key.as_str() { "default" => d, + // A posterised image of a photo or of artwork: its own colours where it is flat art, as + // many as its tones need where it is not. + // (Color detail 85: a colour on a hundredth of the picture is still one of its colours.) + "auto color" => TraceParams { palette: Palette::Automatic, color_detail: 85.0, ..color(6, 65.0, 60.0, 16, Method::Abutting) }, "high fidelity photo" => color(64, 90.0, 25.0, 4, Method::Overlapping), "low fidelity photo" => color(20, 60.0, 50.0, 12, Method::Overlapping), "3 colors" => color(3, 60.0, 60.0, 20, Method::Abutting), @@ -403,6 +414,8 @@ pub fn preset(name: &str) -> Option { "silhouettes" => bw(200, 40.0, 60.0, 30, false), "line art" => bw(128, 80.0, 70.0, 10, false), "technical drawing" => bw(128, 95.0, 90.0, 4, true), + // Black outlines: lines as stroked centre lines, wider areas as stroked outlines. + "outline" => TraceParams { fills: false, strokes: true, ..bw(128, 80.0, 70.0, 10, false) }, // Flat-colour logos: colours found automatically, edges placed to a fraction of a pixel. "flat logo" => TraceParams { mode: Mode::Logo, colors: 8, paths: 60.0, corners: 50.0, noise: 6, snap_curves_to_lines: true, ..d }, _ => return None, @@ -446,6 +459,14 @@ fn is_white(c: [u8; 3]) -> bool { c.iter().all(|&v| v >= 245) } +/// Whether Ignore Color leaves palette colour `c` out: `target` is the colour picked (`None`: white). +fn is_ignored(c: [u8; 3], target: Option<[u8; 3]>) -> bool { + match target { + None => is_white(c), + Some(t) => (0..3).map(|k| (f64::from(c[k]) - f64::from(t[k])).powi(2)).sum::() <= 30.0 * 30.0 || (is_white(t) && is_white(c)), + } +} + /// Trace `img` with `params`. Failures (an image Logo mode refuses, say) give an empty result: use /// [`trace_within`] to see why. pub fn trace(img: &Raster, params: &TraceParams) -> TraceResult { @@ -464,6 +485,11 @@ pub fn trace_within(img: &Raster, params: &TraceParams, max_anchors: usize) -> R if params.mode == Mode::Logo { return logo::trace_logo(img, params, max_anchors); } + // The colour Ignore Color leaves out, if not white. + let ignore = match ¶ms.ignore_color { + Some(name) if params.ignore_white => Some(logo::parse_hex(name).ok_or_else(|| TraceError::BadPalette(name.clone()))?), + _ => None, + }; // A photo is traced from a copy with its noise smoothed away (see `smooth`). let smoothed = (params.mode != Mode::BlackAndWhite && quantize::continuous_tone(img)).then(|| smooth::smoothed(img)); let img = smoothed.as_ref().unwrap_or(img); @@ -500,12 +526,13 @@ pub fn trace_within(img: &Raster, params: &TraceParams, max_anchors: usize) -> R rank[i] = r; } let layers: Vec<(usize, usize)> = - order.iter().copied().enumerate().filter(|&(_, ci)| !(params.ignore_white && is_white(q.palette[ci]))).collect(); + order.iter().copied().enumerate().filter(|&(_, ci)| !(params.ignore_white && is_ignored(q.palette[ci], ignore))).collect(); let job = Layers { q: &q, rank: &rank, params, img, + ignore, boxes, bw_tones: bw_tones(img, &q), style: params.outline_style(), @@ -571,6 +598,8 @@ struct Layers<'a> { rank: &'a [usize], params: &'a TraceParams, img: &'a Raster, + /// The colour Ignore Color leaves out, if not white. + ignore: Option<[u8; 3]>, /// The box each palette entry's pixels lie in: `(x0, y0, x1, y1)`, the far sides excluded. boxes: Vec>, /// Black and White: the luminance of white and of black (see `bw_tones`). @@ -590,7 +619,7 @@ impl Layers<'_> { /// Ignore White: white is no part of any layer (stacked layers reach under the layers above /// them, and must not reach under white that is left out). fn ignored(&self, label: u16) -> bool { - self.params.ignore_white && self.q.palette.get(label as usize).is_some_and(|c| is_white(*c)) + self.params.ignore_white && self.q.palette.get(label as usize).is_some_and(|c| is_ignored(*c, self.ignore)) } /// The region across a crack, for cutting outlines at their junctions: the outside pixel's /// colour. Stacked layers end on many colours at once and share no edge: one neighbour. diff --git a/crates/trace/src/logo/mod.rs b/crates/trace/src/logo/mod.rs index 336ba262..865c7172 100644 --- a/crates/trace/src/logo/mod.rs +++ b/crates/trace/src/logo/mod.rs @@ -26,5 +26,6 @@ mod unmix; pub(crate) use geom::{Cubic, all_within, resample_closed, resample_open, sample_cubics}; pub(crate) use outline::{Stats, Style, fit_open, fit_outline}; +pub(crate) use palette::parse_hex; pub(crate) use pipeline::trace_logo; pub(crate) use restore::RestoreParams; diff --git a/crates/trace/src/tests.rs b/crates/trace/src/tests.rs index 7286f646..2daf307c 100644 --- a/crates/trace/src/tests.rs +++ b/crates/trace/src/tests.rs @@ -255,7 +255,7 @@ fn snap_curves_to_lines_straightens_near_lines() { #[test] fn presets_resolve() { - assert_eq!(presets().len(), 13); + assert_eq!(presets().len(), 15); for n in PRESET_NAMES { assert!(preset(n).is_some(), "{n}"); } @@ -1072,3 +1072,24 @@ fn a_blurred_thin_line_on_unevenly_lit_paper_is_a_few_anchors() { let off = along(path).iter().filter(|p| p.x > 14.0 && p.x < 146.0).map(|p| ((p.y - (17.3 + 0.06 * p.x)).abs() - 1.0).abs()).fold(0.0, f64::max); assert!(off < 0.5, "edges {off} px from where the ink's width puts them"); } + +#[test] +fn ignore_color_leaves_out_the_colour_picked() { + // Navy field, yellow disc, green bar. + let img = three_colour_art(0.0); + let params = TraceParams { colors: 3, ignore_white: true, ..sixteen_colors() }; + // White by default: nothing here is white. + assert_eq!(trace(&img, ¶ms).paths.len(), 3); + // The navy picked a little off: the field goes, the disc and the bar stay. + let res = trace(&img, &TraceParams { ignore_color: Some("#18263c".replace("3c", "5e")), ..params.clone() }); + assert_eq!(res.paths.len(), 2); + assert!(res.paths.iter().all(|p| p.color != [20, 40, 90])); + // Not ticked, the colour is not left out; and a colour that is none is refused. + assert_eq!(trace(&img, &TraceParams { ignore_white: false, ignore_color: Some("#14285a".into()), ..params.clone() }).paths.len(), 3); + let bad = trace_within(&img, &TraceParams { ignore_color: Some("navy".into()), ..params.clone() }, usize::MAX); + assert!(matches!(bad, Err(TraceError::BadPalette(_)))); + // Old documents have no such setting: white. + let old: TraceParams = serde_json::from_str(r#"{"mode":"color","ignoreWhite":true}"#).unwrap(); + assert_eq!(old.ignore_color, None); + assert_eq!(serde_json::to_value(¶ms).unwrap()["ignoreColor"], serde_json::Value::Null); +} diff --git a/crates/trace/tests/quality/main.rs b/crates/trace/tests/quality/main.rs index 4a8603d1..cd858e00 100644 --- a/crates/trace/tests/quality/main.rs +++ b/crates/trace/tests/quality/main.rs @@ -68,10 +68,10 @@ fn target(preset: &str, input: &Input) -> bool { "High Fidelity Photo" | "Low Fidelity Photo" | "Shades of Gray" => &[Class::Tone], // Three colours cannot show the badge's five. "3 Colors" => return input.name == "two touching halves", - "6 Colors" | "16 Colors" | "Flat Logo" => &[Class::Flat], + "6 Colors" | "16 Colors" | "Flat Logo" | "Auto Color" => &[Class::Flat], "Sketched Art" => &[Class::Shape, Class::Lines], "Silhouettes" => &[Class::Shape], - "Line Art" => &[Class::Lines], + "Line Art" | "Outline" => &[Class::Lines], "Technical Drawing" => &[Class::Lines, Class::Poly], _ => &[Class::Shape, Class::Poly], }; diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index f74e232a..3c482992 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -621,6 +621,7 @@ VectorCraft on GitHub VectorCraft na GitHubu Search Commands… Hledat příkazy… VectorCraft Help… Nápověda VectorCraft… + Auto Color Automatická barva Automatic Automaticky Isolate Selected Group Izolovat vybranou skupinu Exit Isolation Mode Ukončit izolovaný režim @@ -1424,6 +1425,7 @@ lighting Light Světlo Abutting Sousedící Black and White Černobílé Corners Rohy + Ignore Color Ignorovat barvu Ignore White Ignorovat bílou Palette: Paleta: Limited Omezená @@ -3660,6 +3662,7 @@ effect Regular Pravidelný Stroke Pressure Tlak tahu # Plurals: one|few|other +imageTrace Outline Obrys @plural {n} item|{n} items {n} položka|{n} položky|{n} položek @plural Color Table ({n} color)|Color Table ({n} colors) Tabulka barev ({n} barva)|Tabulka barev ({n} barvy)|Tabulka barev ({n} barev) @plural Delete this {n} graphic style?|Delete these {n} graphic styles? Odstranit {n} grafický styl?|Odstranit {n} grafické styly?|Odstranit {n} grafických stylů? diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index dd59b508..105a8e0c 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -229,6 +229,7 @@ Author Title: Titel des Autors: Author: Autor: Auto Auto + Auto Color Automatische Farbe Automatic Automatisch Auto Size New Area Type Größe von neuem Flächentext automatisch anpassen Auto Spell Check Automatische Rechtschreibprüfung @@ -1226,6 +1227,7 @@ Identify Objects By Objekte identifizieren nach Ignore Ignorieren Ignore Artboards (all the art as one page) Zeichenflächen ignorieren (gesamte Grafik als eine Seite) + Ignore Color Farbe ignorieren Ignore White Weiß ignorieren Palette: Palette: Limited Begrenzt @@ -3135,6 +3137,7 @@ effect Points Punkte {warning}: click to correct to the closest color ({hex}) {warning}: Klicken korrigiert auf die nächstliegende Farbe ({hex}) “{file}” is protected by a password. „{file}“ ist durch ein Kennwort geschützt. ● Recording ● Aufzeichnung +imageTrace Outline Kontur @plural {n} item|{n} items {n} Element|{n} Elemente @plural Color Table ({n} color)|Color Table ({n} colors) Farbtabelle ({n} Farbe)|Farbtabelle ({n} Farben) @plural Delete this {n} graphic style?|Delete these {n} graphic styles? Diesen {n} Grafikstil löschen?|Diese {n} Grafikstile löschen? diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 467763bf..07451c6b 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -247,6 +247,7 @@ Author Title: Cargo del autor: Author: Autor: Auto Auto + Auto Color Color automático Automatic Automático Auto Size New Area Type Ajustar automáticamente el tamaño del nuevo texto de área Auto Spell Check Revisión ortográfica automática @@ -1244,6 +1245,7 @@ Identify Objects By Identificar objetos por Ignore Ignorar Ignore Artboards (all the art as one page) Ignorar mesas de trabajo (toda la ilustración como una página) + Ignore Color Ignorar color Ignore White Ignorar blanco Palette: Paleta: Limited Limitada @@ -3236,6 +3238,7 @@ {warning}: click to correct to the closest color ({hex}) {warning}: clic para corregir al color más cercano ({hex}) “{file}” is protected by a password. “{file}” está protegido con contraseña. ● Recording ● Grabando +imageTrace Outline Contorno @plural {n} item|{n} items {n} elemento|{n} elementos @plural Color Table ({n} color)|Color Table ({n} colors) Tabla de colores ({n} color)|Tabla de colores ({n} colores) @plural Delete this {n} graphic style?|Delete these {n} graphic styles? ¿Eliminar {n} estilo gráfico?|¿Eliminar estos {n} estilos gráficos? diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 1bbe6c4e..5ca5d91a 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -248,6 +248,7 @@ Author Title: Fonction de l’auteur : Author: Auteur : Auto Auto + Auto Color Couleur automatique Automatic Automatique Auto Size New Area Type Taille automatique du nouveau texte captif Auto Spell Check Vérification orthographique automatique @@ -1243,6 +1244,7 @@ Identify Objects By Identifier les objets par Ignore Ignorer Ignore Artboards (all the art as one page) Ignorer les plans de travail (toute l’illustration sur une page) + Ignore Color Ignorer la couleur Ignore White Ignorer le blanc Palette: Palette : Limited Limitée @@ -3233,6 +3235,7 @@ {warning}: click to correct to the closest color ({hex}) {warning} : cliquez pour corriger avec la couleur la plus proche ({hex}) “{file}” is protected by a password. « {file} » est protégé par un mot de passe. ● Recording ● Enregistrement +imageTrace Outline Contour @plural {n} item|{n} items {n} élément|{n} éléments @plural Color Table ({n} color)|Color Table ({n} colors) Table des couleurs ({n} couleur)|Table des couleurs ({n} couleurs) @plural Delete this {n} graphic style?|Delete these {n} graphic styles? Supprimer {n} style graphique ?|Supprimer ces {n} styles graphiques ? diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 8d200e38..c17af681 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -360,6 +360,7 @@ Auto Spell Check Automatikus helyesírás-ellenőrzés Auto-Collapse Iconic Panels Ikonpanelek automatikus becsukása Auto-Rotate (turn the paper to each artboard) Automatikus elforgatás (a papír igazodik minden rajztáblához) + Auto Color Automatikus szín Automatic Automatikus Automatic flatness Automatikus simaság Automatically Automatikusan @@ -1608,6 +1609,7 @@ Identify Objects By Objektumok azonosítása Ignore Kihagy Ignore Artboards (all the art as one page) Rajztáblák figyelmen kívül hagyása (az összes grafika egy oldalon) + Ignore Color Szín figyelmen kívül hagyása Ignore White Fehér figyelmen kívül hagyása Image Kép Image Info Kép adatai @@ -3935,6 +3937,7 @@ lighting Light Fény theme Appearance Kinézet # Plurals: one|other +imageTrace Outline Körvonal @plural Color Table ({n} color)|Color Table ({n} colors) Színtábla ({n} szín) @plural Delete this {n} graphic style?|Delete these {n} graphic styles? {n} grafikai stílus törlése? @plural {n} area highlighted|{n} areas highlighted Kiemelt terület: {n} diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 831a25c8..7852c2e7 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -247,6 +247,7 @@ Author Title: Qualifica dell'autore: Author: Autore: Auto Auto + Auto Color Colore automatico Automatic Automatico Auto Size New Area Type Dimensionamento automatico del nuovo testo in area Auto Spell Check Controllo ortografico automatico @@ -1243,6 +1244,7 @@ Identify Objects By Identifica oggetti per Ignore Ignora Ignore Artboards (all the art as one page) Ignora tavole da disegno (tutta la grafica come una sola pagina) + Ignore Color Ignora colore Ignore White Ignora bianco Palette: Palette: Limited Limitata @@ -3236,6 +3238,7 @@ {warning}: click to correct to the closest color ({hex}) {warning}: fai clic per correggere con il colore più vicino ({hex}) “{file}” is protected by a password. “{file}” è protetto da password. ● Recording ● Registrazione in corso +imageTrace Outline Contorno @plural {n} item|{n} items {n} elemento|{n} elementi @plural Color Table ({n} color)|Color Table ({n} colors) Tabella colori ({n} colore)|Tabella colori ({n} colori) @plural Delete this {n} graphic style?|Delete these {n} graphic styles? Eliminare {n} stile grafico?|Eliminare questi {n} stili grafici? diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 5a58ed6b..0bddb667 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -666,6 +666,7 @@ Hide Print Tiling プリント分割を隠す Unlock Grid グリッドをロック解除 Edit Envelope エンベロープを編集 + Auto Color 自動カラー Automatic 自動 Isolate Selected Group 選択したグループを分離 Exit Isolation Mode 分離モードを終了 @@ -1481,6 +1482,7 @@ Identify Objects By オブジェクトの識別方法 Ignore 無視 Ignore Artboards (all the art as one page) アートボードを無視 (すべてのアートを 1 ページとして扱う) + Ignore Color カラーを無視 Ignore White 白を無視 Palette: パレット: Limited 限定 @@ -3225,6 +3227,7 @@ Yellow イエロー [Normal Character Style] [標準文字スタイル] [Normal Paragraph Style] [標準段落スタイル] +imageTrace Outline アウトライン @plural Color Table ({n} color)|Color Table ({n} colors) カラーテーブル ({n} 色) @plural Delete this {n} graphic style?|Delete these {n} graphic styles? {n} 個のグラフィックスタイルを削除しますか? @plural {n} Layer|{n} Layers {n} レイヤー diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 51b3c826..7c3cb271 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -664,6 +664,7 @@ Hide Print Tiling 인쇄 타일링 숨기기 Unlock Grid 격자 잠금 해제 Edit Envelope 엔벨로프 편집 + Auto Color 자동 색상 Automatic 자동 Isolate Selected Group 선택한 그룹 격리 Exit Isolation Mode 격리 모드 종료 @@ -1476,6 +1477,7 @@ Identify Objects By 개체 식별 기준 Ignore 무시 Ignore Artboards (all the art as one page) 아트보드 무시 (모든 아트웍을 한 페이지로) + Ignore Color 색상 무시 Ignore White 흰색 무시 Palette: 팔레트: Limited 제한 @@ -3218,6 +3220,7 @@ Yellow 노랑 [Normal Character Style] [기본 문자 스타일] [Normal Paragraph Style] [기본 단락 스타일] +imageTrace Outline 윤곽선 @plural Color Table ({n} color)|Color Table ({n} colors) 색상 표 ({n}색)|색상 표 ({n}색) @plural Delete this {n} graphic style?|Delete these {n} graphic styles? 그래픽 스타일 {n}개를 삭제하시겠습니까?|그래픽 스타일 {n}개를 삭제하시겠습니까? @plural {n} Layer|{n} Layers 레이어 {n}개|레이어 {n}개 diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index e69defff..b544cc84 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -606,6 +606,7 @@ VectorCraft on GitHub VectorCraft w serwisie GitHub Search Commands… Szukaj poleceń… VectorCraft Help… Pomoc VectorCraft… + Auto Color Kolor automatyczny Automatic Automatycznie Isolate Selected Group Izoluj zaznaczoną grupę Exit Isolation Mode Wyjdź z trybu izolacji @@ -1374,6 +1375,7 @@ lighting Light Światło Abutting Stykające się Black and White Czarno-biały Corners Narożniki + Ignore Color Ignoruj kolor Ignore White Ignoruj biel Palette: Paleta: Limited Ograniczona @@ -3528,6 +3530,7 @@ effect Regular Normalny Stroke Direction Kierunek pociągnięć Stroke Width Szerokość pociągnięć Stroke Pressure Nacisk pociągnięć +imageTrace Outline Kontur @plural {n} item|{n} items {n} element|{n} elementy|{n} elementów @plural Color Table ({n} color)|Color Table ({n} colors) Tablica kolorów ({n} kolor)|Tablica kolorów ({n} kolory)|Tablica kolorów ({n} kolorów) @plural Delete this {n} graphic style?|Delete these {n} graphic styles? Usunąć {n} styl graficzny?|Usunąć {n} style graficzne?|Usunąć {n} stylów graficznych? diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index d6ee969c..73a42222 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -1070,7 +1070,7 @@ Identify Objects By Identificar Objetos Por Ignore Ignorar Ignore Artboards (all the art as one page) Ignorar Mesas de Trabalho (toda a arte como uma página) - Ignore White Ignorar Branco + Ignore Color Ignorar Cor Image Info Informações da Imagem Image Map: Mapa da Imagem: Image Size Tamanho da Imagem @@ -2661,6 +2661,7 @@ {warning}: click to correct to the closest color ({hex}) {warning}: clique para corrigir para a cor mais próxima ({hex}) “{file}” is protected by a password. “{file}” é protegido por uma senha. ● Recording ● Gravando +imageTrace Outline Contorno @plural {n} item|{n} items {n} item|{n} itens @plural Color Table ({n} color)|Color Table ({n} colors) Tabela de Cores ({n} cor)|Tabela de Cores ({n} cores) @plural Delete this {n} graphic style?|Delete these {n} graphic styles? Excluir este {n} estilo gráfico?|Excluir estes {n} estilos gráficos? diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index dd5983bc..480b698e 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -245,6 +245,7 @@ Author Title: Должность автора: Author: Автор: Auto Авто + Auto Color Автоцвет Automatic Автоматически Auto Size New Area Type Автоматически подгонять размер нового текста в области Auto Spell Check Автоматическая проверка орфографии @@ -1241,6 +1242,7 @@ Identify Objects By Определять объекты по Ignore Игнорировать Ignore Artboards (all the art as one page) Игнорировать монтажные области (весь рисунок как одна страница) + Ignore Color Игнорировать цвет Ignore White Игнорировать белый Palette: Палитра: Limited Ограниченная @@ -3232,6 +3234,7 @@ {warning}: click to correct to the closest color ({hex}) {warning}: щёлкните для исправления на ближайший цвет ({hex}) “{file}” is protected by a password. «{file}» защищён паролем. ● Recording ● Запись +imageTrace Outline Контур @plural {n} item|{n} items {n} элемент|{n} элемента|{n} элементов @plural Color Table ({n} color)|Color Table ({n} colors) Цветовая таблица ({n} цвет)|Цветовая таблица ({n} цвета)|Цветовая таблица ({n} цветов) @plural Delete this {n} graphic style?|Delete these {n} graphic styles? Удалить этот графический стиль ({n})?|Удалить эти графические стили ({n})?|Удалить эти графические стили ({n})? diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index a6abc016..8bb09d7e 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -241,6 +241,7 @@ Author Title: Посада автора: Author: Автор: Auto Авто + Auto Color Автоколір Automatic Автоматично Auto Size New Area Type Автоматично підганяти розмір нового тексту в області Auto Spell Check Автоматична перевірка орфографії @@ -1237,6 +1238,7 @@ Identify Objects By Визначати об’єкти по Ignore Ігнорувати Ignore Artboards (all the art as one page) Ігнорувати монтажні області (весь малюнок як одна сторінка) + Ignore Color Ігнорувати колір Ignore White Ігнорувати білий Palette: Палітра: Limited Обмежена @@ -3229,6 +3231,7 @@ effect Points Точки {warning}: click to correct to the closest color ({hex}) {warning}: натисніть , щоб виправити найближчий колір ({hex}) “{file}” is protected by a password. "{file}" захищений паролем. ● Recording ● Запис +imageTrace Outline Контур @plural {n} item|{n} items {n} елемент|{n} елементи|{n} елементів @plural Color Table ({n} color)|Color Table ({n} colors) Таблиця кольорів ({n} колір)|Таблиця кольорів ({n} кольори)|Таблиця кольорів ({n} кольорів) @plural Delete this {n} graphic style?|Delete these {n} graphic styles? Видалити цей графічний стиль ({n})?|Видалити ці графічні стилі ({n})?|Видалити ці графічні стилі ({n})? diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index fc1dbf0f..59c05473 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -288,6 +288,7 @@ Auto Spell Check Kiểm tra chính tả tự động Auto-Collapse Iconic Panels Tự động thu gọn bảng dạng biểu tượng Auto-Rotate (turn the paper to each artboard) Tự động xoay (xoay trang cho mỗi bảng vẽ) + Auto Color Màu tự động Automatic Tự động Automatic flatness Độ phẳng tự động Automatically Tự động @@ -1437,6 +1438,7 @@ Identify Objects By Nhận diện đối tượng theo Ignore Bỏ qua Ignore Artboards (all the art as one page) Bỏ qua bảng vẽ (toàn bộ bản vẽ thành một trang) + Ignore Color Bỏ qua màu Ignore White Bỏ qua màu trắng Image Hình ảnh Image Info Thông tin hình ảnh @@ -3556,6 +3558,7 @@ {warning}: click to correct to the closest color ({hex}) {warning}: bấm để chỉnh sang màu gần nhất ({hex}) “{file}” is protected by a password. “{file}” được bảo vệ bằng mật khẩu. ● Recording ● Đang ghi +imageTrace Outline Đường viền @plural Color Table ({n} color)|Color Table ({n} colors) Bảng màu ({n} màu) @plural Delete this {n} graphic style?|Delete these {n} graphic styles? Xóa {n} kiểu đồ họa này? @plural {n} area highlighted|{n} areas highlighted {n} vùng được tô sáng diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 54d6595e..2c98f685 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -205,6 +205,7 @@ Author Title: 作者职务: Author: 作者: Auto 自动 + Auto Color 自动颜色 Automatic 自动 Auto Size New Area Type 自动调整新区域文字大小 Auto Spell Check 自动拼写检查 @@ -1189,6 +1190,7 @@ Identify Objects By 对象识别方式 Ignore 忽略 Ignore Artboards (all the art as one page) 忽略画板 (所有图稿作为一页) + Ignore Color 忽略颜色 Ignore White 忽略白色 Palette: 调板: Limited 有限 @@ -3129,6 +3131,7 @@ {warning}: click to correct to the closest color ({hex}) {warning}:单击以修正为最接近的颜色 ({hex}) “{file}” is protected by a password. “{file}”受密码保护。 ● Recording ● 录制中 +imageTrace Outline 轮廓 @plural {n} item|{n} items {n} 个项目 @plural Color Table ({n} color)|Color Table ({n} colors) 颜色表 ({n} 色) @plural Delete this {n} graphic style?|Delete these {n} graphic styles? 要删除这 {n} 个图形样式吗? diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 302f0ac5..6b9fc177 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -216,6 +216,7 @@ Author Title: 作者職稱: Author: 作者: Auto 自動 + Auto Color 自動顏色 Automatic 自動 Auto Size New Area Type 自動調整新區域文字大小 Auto Spell Check 自動拼字檢查 @@ -1219,6 +1220,7 @@ Identify Objects By 識別物件依據 Ignore 略過 Ignore Artboards (all the art as one page) 忽略工作區域 (所有圖稿視為單一頁面) + Ignore Color 忽略顏色 Ignore White 忽略白色 Palette: 調色盤: Limited 有限 @@ -3222,6 +3224,7 @@ {warning}: click to correct to the closest color ({hex}) {warning}:按一下以修正為最接近的顏色 ({hex}) “{file}” is protected by a password. 「{file}」受密碼保護。 ● Recording ● 錄製中 +imageTrace Outline 輪廓 @plural {n} item|{n} items {n} 個項目 @plural Color Table ({n} color)|Color Table ({n} colors) 色彩表 ({n} 色) @plural Delete this {n} graphic style?|Delete these {n} graphic styles? 要刪除這 {n} 個繪圖樣式嗎? diff --git a/crates/ui-egui/src/panels/image_trace.rs b/crates/ui-egui/src/panels/image_trace.rs index b7bc0613..592e98c5 100644 --- a/crates/ui-egui/src/panels/image_trace.rs +++ b/crates/ui-egui/src/panels/image_trace.rs @@ -19,6 +19,16 @@ const MODES: [(&str, &str); 4] = [("blackAndWhite", "Black and White"), ("graysc const PALETTES: [&str; 4] = ["limited", "fullTone", "automatic", "documentLibrary"]; /// Palette `id`, in the UI language. +/// The colour Ignore Color leaves out in `params` (`ignoreColor`, `#rrggbb`): white when there is none. +fn ignore_color(params: &Value) -> [u8; 3] { + let hex = params["ignoreColor"].as_str().unwrap_or("").trim_start_matches('#'); + let channel = |i: usize| hex.get(i * 2..i * 2 + 2).and_then(|h| u8::from_str_radix(h, 16).ok()); + match (hex.len(), channel(0), channel(1), channel(2)) { + (6, Some(r), Some(g), Some(b)) => [r, g, b], + _ => [255; 3], + } +} + fn palette_label(id: &str) -> &'static str { match id { "fullTone" => tl!("Full Tone"), @@ -128,10 +138,16 @@ fn trace_with(app: &mut VectorcraftApp, preset: &str) { /// The built-in presets to choose from (`current` highlighted) → the one chosen. Listed only /// while the menu is open. +/// A preset's name as shown: translated as a preset's name where the catalog has it so (the +/// Outline preset is not the Outline view), as any other string else. +fn preset_label(name: &str) -> &str { + crate::i18n::tr_ctx(crate::i18n::current(), "imageTrace", name) +} + fn preset_list(app: &mut VectorcraftApp, ui: &mut Ui, current: &str) -> Option { let mut chosen = None; for (name, _) in presets(app) { - if ui.add(egui::Button::selectable(name == current, tl!(&name))).clicked() { + if ui.add(egui::Button::selectable(name == current, preset_label(&name))).clicked() { chosen = Some(name); } } @@ -338,14 +354,29 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { } retrace |= release; } - for (key, label) in [("snapCurvesToLines", tl!("Snap Curves To Lines")), ("ignoreWhite", tl!("Ignore White"))] { - let on = st.params[key].as_bool().unwrap_or(false); - if widgets::check(ui, label, on, true) { - st.params[key] = json!(!on); + let snap = st.params["snapCurvesToLines"].as_bool().unwrap_or(false); + if widgets::check(ui, tl!("Snap Curves To Lines"), snap, true) { + st.params["snapCurvesToLines"] = json!(!snap); + st.preset = "Custom".into(); + retrace = true; + } + // Ignore Color: white, unless another colour is picked. + ui.horizontal(|ui| { + let on = st.params["ignoreWhite"].as_bool().unwrap_or(false); + if widgets::check(ui, tl!("Ignore Color"), on, true) { + st.params["ignoreWhite"] = json!(!on); st.preset = "Custom".into(); retrace = true; } - } + if on { + let mut rgb = ignore_color(&st.params); + if ui.color_edit_button_srgb(&mut rgb).changed() { + st.params["ignoreColor"] = json!(format!("#{:02x}{:02x}{:02x}", rgb[0], rgb[1], rgb[2])); + st.preset = "Custom".into(); + retrace = true; + } + } + }); } widgets::divider(ui); if let Some((p, a, c)) = st.info { diff --git a/docs/image-trace-quality.md b/docs/image-trace-quality.md index 427bb25e..e13bab32 100644 --- a/docs/image-trace-quality.md +++ b/docs/image-trace-quality.md @@ -1,6 +1,6 @@ # Image Trace quality -> **Last reviewed:** 2026-10-13 · **Last updated:** 2026-10-13 · **Change:** minor (thin lines in blurred and scanned art: Line Art 78 anchors to 46, 0.093 px off to 0.055) +> **Last reviewed:** 2026-10-13 · **Last updated:** 2026-10-13 · **Change:** minor (two documented presets, Auto Color and Outline, measured; Ignore Color) What Image Trace (`crates/trace`) makes of images whose right answer is known, measured by a harness and compared with the numbers before each change. Nothing here is a judgement by eye, and nothing is compared @@ -72,11 +72,12 @@ Each preset on the inputs it is meant for, all sizes and variants. | Technical Drawing | polygons, star, letter A, lines | 2.66 | 13.45 | 0.201 | 1.37 | 105.76 | 4.8 | 32 | 2.23 | 100 | 85 | 5.9 | – | – | – | – | 0.1 | 0.0 | | Flat Logo | two touching halves, four-colour badge | 0.43 | 3.53 | 3.106 | 88.50 | 0.78 | 69.9 | 352 | 38.92 | 38 | 80 | 237.0 | 0.0 | 0 | 13.8 | – | 59.1 | 0.2 | -### Now (sub-pixel edges, the palette, photo smoothing, shared edges, memory, thin lines) +### Now (sub-pixel edges, the palette, photo smoothing, shared edges, memory, thin lines, two more presets) | preset | inputs | ΔE | edge ΔE | off mean | off max | missed max | paths | anchors | × art | lines % | corners % | kinks | odd colours | odd px | gap px | overlap px | specks | outside px | |:--|:--|--:|--:|--:|--:|--:|--:|--:|--:|--:|--:|--:|--:|--:|--:|--:|--:|--:| | Default | circle, ellipses, badge with a hole, letter D, polygons, star, letter A | 2.60 | 10.02 | 0.090 | 1.02 | 2.22 | 1.9 | 17 | 1.74 | 29 | 69 | 0.4 | – | – | 0.5 | 0.6 | 0.0 | 0.0 | +| Auto Color | two touching halves, four-colour badge | 0.55 | 4.98 | 0.140 | 1.33 | 1.21 | 4.0 | 53 | 3.28 | 38 | 86 | 5.1 | 0.0 | 0 | 1.4 | 1.1 | 0.0 | 0.0 | | High Fidelity Photo | gradient, photo-like | 1.75 | 1.97 | – | – | – | 120.7 | 10001 | – | 38 | – | – | – | – | 0.0 | – | 10.3 | 0.0 | | Low Fidelity Photo | gradient, photo-like | 2.45 | 2.69 | – | – | – | 37.1 | 2118 | – | 41 | – | – | – | – | 0.0 | – | 0.0 | 0.0 | | 3 Colors | two touching halves | 0.42 | 3.98 | 0.104 | 0.91 | 0.91 | 2.0 | 11 | 1.81 | 39 | 100 | 0.0 | 0.0 | 0 | 0.0 | 0.0 | 0.0 | 0.0 | @@ -88,9 +89,10 @@ Each preset on the inputs it is meant for, all sizes and variants. | Silhouettes | circle, ellipses, badge with a hole, letter D | 2.98 | 19.28 | 0.524 | 2.19 | 2.18 | 1.2 | 14 | 1.65 | 11 | 79 | 0.3 | – | – | – | – | 0.0 | 0.0 | | Line Art | lines | 2.62 | 9.44 | 0.055 | 0.96 | 105.82 | 5.4 | 46 | 2.29 | 41 | – | – | – | – | – | – | 0.1 | 0.0 | | Technical Drawing | polygons, star, letter A, lines | 2.54 | 9.65 | 0.084 | 1.02 | 105.82 | 4.8 | 46 | 3.23 | 71 | 73 | 0.8 | – | – | – | – | 1.2 | 0.0 | +| Outline | lines | 2.93 | 15.91 | 0.310 | 1.84 | 106.00 | 5.0 | 81 | 4.03 | 15 | – | – | – | – | – | – | 0.0 | 0.0 | | Flat Logo | two touching halves, four-colour badge | 0.43 | 3.53 | 3.106 | 88.50 | 0.78 | 69.9 | 352 | 38.92 | 38 | 80 | 237.0 | 0.0 | 0 | 13.8 | – | 59.1 | 0.2 | -The sections below are the numbers now (sub-pixel edges, the palette, photo smoothing, shared edges, memory, thin lines). +The sections below are the numbers now (sub-pixel edges, the palette, photo smoothing, shared edges, memory, thin lines, two more presets). ## 1. Each preset on the inputs it is meant for @@ -99,6 +101,7 @@ All sizes and variants (clean, aliased, blurred, noisy, scanned) of those inputs | preset | inputs | ΔE | edge ΔE | off mean | off max | missed max | paths | anchors | × art | lines % | corners % | kinks | odd colours | odd px | gap px | overlap px | specks | outside px | |:--|:--|--:|--:|--:|--:|--:|--:|--:|--:|--:|--:|--:|--:|--:|--:|--:|--:|--:| | Default | circle, ellipses, badge with a hole, letter D, polygons, star, letter A | 2.60 | 10.02 | 0.090 | 1.02 | 2.22 | 1.9 | 17 | 1.74 | 29 | 69 | 0.4 | – | – | 0.5 | 0.6 | 0.0 | 0.0 | +| Auto Color | two touching halves, four-colour badge | 0.55 | 4.98 | 0.140 | 1.33 | 1.21 | 4.0 | 53 | 3.28 | 38 | 86 | 5.1 | 0.0 | 0 | 1.4 | 1.1 | 0.0 | 0.0 | | High Fidelity Photo | gradient, photo-like | 1.75 | 1.97 | – | – | – | 120.7 | 10001 | – | 38 | – | – | – | – | 0.0 | – | 10.3 | 0.0 | | Low Fidelity Photo | gradient, photo-like | 2.45 | 2.69 | – | – | – | 37.1 | 2118 | – | 41 | – | – | – | – | 0.0 | – | 0.0 | 0.0 | | 3 Colors | two touching halves | 0.42 | 3.98 | 0.104 | 0.91 | 0.91 | 2.0 | 11 | 1.81 | 39 | 100 | 0.0 | 0.0 | 0 | 0.0 | 0.0 | 0.0 | 0.0 | @@ -110,6 +113,7 @@ All sizes and variants (clean, aliased, blurred, noisy, scanned) of those inputs | Silhouettes | circle, ellipses, badge with a hole, letter D | 2.98 | 19.28 | 0.524 | 2.19 | 2.18 | 1.2 | 14 | 1.65 | 11 | 79 | 0.3 | – | – | – | – | 0.0 | 0.0 | | Line Art | lines | 2.62 | 9.44 | 0.055 | 0.96 | 105.82 | 5.4 | 46 | 2.29 | 41 | – | – | – | – | – | – | 0.1 | 0.0 | | Technical Drawing | polygons, star, letter A, lines | 2.54 | 9.65 | 0.084 | 1.02 | 105.82 | 4.8 | 46 | 3.23 | 71 | 73 | 0.8 | – | – | – | – | 1.2 | 0.0 | +| Outline | lines | 2.93 | 15.91 | 0.310 | 1.84 | 106.00 | 5.0 | 81 | 4.03 | 15 | – | – | – | – | – | – | 0.0 | 0.0 | | Flat Logo | two touching halves, four-colour badge | 0.43 | 3.53 | 3.106 | 88.50 | 0.78 | 69.9 | 352 | 38.92 | 38 | 80 | 237.0 | 0.0 | 0 | 13.8 | – | 59.1 | 0.2 | ## 2. Each preset on each kind of input (clean, three sizes) @@ -121,6 +125,11 @@ All sizes and variants (clean, aliased, blurred, noisy, scanned) of those inputs | Default | thin lines | 0.53 | 4.28 | 0.045 | 0.47 | 105.51 | 3.3 | 23 | 1.15 | 48 | – | – | – | – | 0.0 | 0.0 | 0.0 | 0.0 | | Default | flat colour art | 19.91 | 17.97 | 0.172 | 0.51 | 179.34 | 1.5 | 16 | 1.17 | 14 | 0 | 0.0 | – | – | 0.0 | 0.0 | 0.0 | 0.0 | | Default | gradient, photo | 39.03 | 38.65 | – | – | – | 3.2 | 601 | – | 54 | – | – | – | – | 19.1 | 38.4 | 0.0 | 0.0 | +| Auto Color | curved shapes | 0.06 | 2.45 | 0.043 | 0.27 | 0.28 | 1.8 | 17 | 1.78 | 15 | 100 | 0.0 | 0.0 | 0 | 0.0 | 0.0 | 0.0 | 0.0 | +| Auto Color | polygons | 0.05 | 2.09 | 0.035 | 0.51 | 1.34 | 2.0 | 15 | 1.33 | 88 | 89 | 0.0 | 0.0 | 0 | 0.0 | 0.0 | 0.0 | 0.0 | +| Auto Color | thin lines | 0.69 | 5.23 | 0.057 | 0.48 | 105.59 | 5.0 | 33 | 1.63 | 57 | – | – | 4.0 | 3216 | 0.0 | 0.0 | 0.0 | 0.0 | +| Auto Color | flat colour art | 0.12 | 2.70 | 0.057 | 0.31 | 0.30 | 3.0 | 28 | 2.00 | 43 | 100 | 0.0 | 0.0 | 0 | 0.0 | 0.0 | 0.0 | 0.0 | +| Auto Color | gradient, photo | 2.07 | 2.38 | – | – | – | 159.3 | 4430 | – | 19 | – | – | – | – | 22.7 | 32.4 | 0.0 | 0.0 | | High Fidelity Photo | curved shapes | 0.04 | 1.66 | 0.026 | 0.18 | 0.20 | 1.2 | 19 | 2.12 | 20 | 100 | 0.0 | 0.0 | 0 | 0.0 | – | 0.0 | 0.0 | | High Fidelity Photo | polygons | 0.05 | 1.88 | 0.031 | 0.51 | 1.34 | 1.7 | 16 | 1.43 | 88 | 89 | 0.0 | 0.0 | 0 | 0.0 | – | 0.0 | 0.0 | | High Fidelity Photo | thin lines | 0.34 | 5.96 | 0.075 | 0.85 | 4.31 | 40.3 | 339 | 16.93 | 37 | – | – | 27.3 | 4490 | 0.0 | – | 19.0 | 0.0 | @@ -176,6 +185,11 @@ All sizes and variants (clean, aliased, blurred, noisy, scanned) of those inputs | Technical Drawing | thin lines | 0.53 | 5.80 | 0.121 | 0.50 | 55.74 | 15.3 | 70 | 3.50 | 88 | – | – | – | – | – | – | 7.7 | 0.0 | | Technical Drawing | flat colour art | 19.90 | 17.76 | 0.157 | 0.30 | 179.51 | 1.0 | 18 | 1.12 | 23 | 0 | 0.0 | – | – | – | – | 0.0 | 0.0 | | Technical Drawing | gradient, photo | 38.94 | 38.51 | – | – | – | 20.0 | 627 | – | 71 | – | – | – | – | – | – | 11.3 | 0.0 | +| Outline | curved shapes | 23.38 | 44.70 | 0.498 | 0.90 | 0.52 | 1.2 | 16 | 1.76 | 19 | 83 | 0.0 | – | – | – | – | 0.0 | 0.0 | +| Outline | polygons | 17.94 | 44.20 | 0.494 | 0.83 | 0.74 | 1.7 | 15 | 1.29 | 88 | 89 | 0.0 | – | – | – | – | 0.0 | 0.0 | +| Outline | thin lines | 0.99 | 14.15 | 0.310 | 1.82 | 106.00 | 3.3 | 88 | 4.40 | 25 | – | – | – | – | – | – | 0.0 | 0.0 | +| Outline | flat colour art | 26.69 | 32.18 | 0.494 | 0.92 | 178.93 | 1.0 | 18 | 1.30 | 21 | 0 | 0.0 | – | – | – | – | 0.0 | 0.0 | +| Outline | gradient, photo | 39.57 | 39.32 | – | – | – | 7.5 | 421 | – | 56 | – | – | – | – | – | – | 0.0 | 0.8 | | Flat Logo | curved shapes | 0.06 | 2.14 | 0.036 | 0.25 | 0.25 | 1.8 | 31 | 3.38 | 19 | 100 | 0.0 | 0.0 | 0 | 6.8 | – | 0.0 | 0.0 | | Flat Logo | polygons | 0.09 | 3.44 | 0.060 | 0.35 | 1.03 | 2.0 | 35 | 3.17 | 67 | 94 | 0.0 | 0.0 | 0 | 6.8 | – | 0.0 | 0.0 | | Flat Logo | thin lines | 1.17 | 11.78 | 0.050 | 0.49 | all | 3.0 | 189 | 9.45 | 28 | – | – | 0.0 | 0 | 5467.1 | – | 0.0 | 0.0 | @@ -191,6 +205,11 @@ All sizes and variants (clean, aliased, blurred, noisy, scanned) of those inputs | Default | blurred | 0.81 | 16.57 | 0.078 | 0.98 | 2.22 | 1.9 | 24 | 2.34 | 5 | 19 | 1.3 | – | – | 0.0 | 0.0 | 0.0 | 0.0 | | Default | noisy | 1.74 | 4.53 | 0.054 | 0.54 | 1.32 | 1.9 | 15 | 1.47 | 41 | 84 | 0.0 | – | – | 1.9 | 0.3 | 0.0 | 0.0 | | Default | scanned | 15.06 | 20.17 | 0.114 | 0.79 | 2.14 | 1.9 | 26 | 2.53 | 2 | 25 | 1.3 | – | – | 1.6 | 4.2 | 0.0 | 0.0 | +| Auto Color | clean | 0.12 | 2.70 | 0.057 | 0.31 | 0.30 | 3.0 | 28 | 2.00 | 43 | 100 | 0.0 | 0.0 | 0 | 0.0 | 0.0 | 0.0 | 0.0 | +| Auto Color | aliased | 0.29 | 10.43 | 0.298 | 1.00 | 1.00 | 3.0 | 27 | 2.05 | 43 | 100 | 0.0 | 0.0 | 0 | 0.0 | 0.0 | 0.0 | 0.0 | +| Auto Color | blurred | 0.61 | 9.31 | 0.208 | 1.33 | 1.21 | 6.0 | 119 | 6.53 | 39 | 50 | 15.5 | 0.0 | 0 | 0.0 | 0.0 | 0.0 | 0.0 | +| Auto Color | noisy | 0.85 | 2.61 | 0.076 | 0.52 | 0.58 | 3.0 | 34 | 2.34 | 28 | 88 | 0.0 | 0.0 | 0 | 0.3 | 0.5 | 0.0 | 0.0 | +| Auto Color | scanned | 1.73 | 4.42 | 0.230 | 1.20 | 0.94 | 7.0 | 108 | 6.02 | 28 | 62 | 20.5 | 0.0 | 0 | 9.6 | 7.5 | 0.0 | 0.0 | | High Fidelity Photo | clean | 1.80 | 2.04 | – | – | – | 134.7 | 11321 | – | 39 | – | – | – | – | 0.0 | – | 7.3 | 0.0 | | High Fidelity Photo | aliased | 1.77 | 2.00 | – | – | – | 73.0 | 8004 | – | 40 | – | – | – | – | 0.0 | – | 5.5 | 0.0 | | High Fidelity Photo | blurred | 1.59 | 1.95 | – | – | – | 72.0 | 7388 | – | 40 | – | – | – | – | 0.0 | – | 0.5 | 0.0 | @@ -246,6 +265,11 @@ All sizes and variants (clean, aliased, blurred, noisy, scanned) of those inputs | Technical Drawing | blurred | 1.03 | 16.48 | 0.076 | 0.96 | 105.82 | 2.0 | 58 | 4.73 | 26 | 25 | 2.7 | – | – | – | – | 0.0 | 0.0 | | Technical Drawing | noisy | 1.41 | 4.24 | 0.053 | 0.50 | 31.79 | 7.8 | 41 | 2.51 | 85 | 86 | 0.0 | – | – | – | – | 2.8 | 0.0 | | Technical Drawing | scanned | 14.44 | 19.98 | 0.100 | 0.87 | 105.79 | 2.0 | 98 | 7.51 | 23 | 34 | 2.7 | – | – | – | – | 0.0 | 0.0 | +| Outline | clean | 0.99 | 14.15 | 0.310 | 1.82 | 106.00 | 3.3 | 88 | 4.40 | 25 | – | – | – | – | – | – | 0.0 | 0.0 | +| Outline | aliased | 0.79 | 17.03 | 0.300 | 1.08 | 55.51 | 11.0 | 93 | 4.65 | 14 | – | – | – | – | – | – | 0.0 | 0.0 | +| Outline | blurred | 1.66 | 18.46 | 0.311 | 1.84 | 105.72 | 3.0 | 68 | 3.40 | 0 | – | – | – | – | – | – | 0.0 | 0.0 | +| Outline | noisy | 1.50 | 12.92 | 0.304 | 1.30 | 56.25 | 8.0 | 74 | 3.70 | 11 | – | – | – | – | – | – | 0.0 | 0.0 | +| Outline | scanned | 13.60 | 20.48 | 0.323 | 1.79 | 105.55 | 3.0 | 65 | 3.25 | 9 | – | – | – | – | – | – | 0.0 | 0.0 | | Flat Logo | clean | 0.07 | 1.53 | 0.065 | 0.31 | 0.27 | 3.0 | 36 | 3.51 | 47 | 100 | 0.0 | 0.0 | 0 | 6.8 | – | 0.0 | 0.0 | | Flat Logo | aliased | 0.13 | 5.87 | 0.218 | 0.65 | 0.65 | 3.0 | 31 | 1.96 | 44 | 50 | 0.0 | 0.0 | 0 | 5.8 | – | 0.0 | 0.0 | | Flat Logo | blurred | 0.54 | 8.33 | 0.052 | 0.62 | 0.78 | 3.0 | 28 | 1.78 | 43 | 50 | 0.0 | 0.0 | 0 | 5.8 | – | 0.0 | 0.0 | @@ -284,18 +308,20 @@ One trace at a time on this machine (all cores); memory is the peak allocated ab |:--|:--|--:|:--| | Default | photo-like | 1 | 0.04 s, 29 paths, 6701 anchors, 12 MB | | Default | four-colour badge | 1 | 0.02 s, 3 paths, 64 anchors, 12 MB | -| High Fidelity Photo | photo-like | 1 | 0.21 s, 968 paths, 114383 anchors, 170 MB | +| Auto Color | photo-like | 1 | 0.15 s, 732 paths, 45410 anchors, 19 MB | +| Auto Color | four-colour badge | 1 | 0.05 s, 5 paths, 84 anchors, 12 MB | +| High Fidelity Photo | photo-like | 1 | 0.22 s, 968 paths, 114383 anchors, 170 MB | | High Fidelity Photo | four-colour badge | 1 | 0.05 s, 6 paths, 172 anchors, 23 MB | -| Low Fidelity Photo | photo-like | 1 | 0.11 s, 129 paths, 22929 anchors, 104 MB | +| Low Fidelity Photo | photo-like | 1 | 0.11 s, 129 paths, 22929 anchors, 105 MB | | Low Fidelity Photo | four-colour badge | 1 | 0.05 s, 6 paths, 136 anchors, 23 MB | -| 3 Colors | photo-like | 1 | 0.08 s, 9 paths, 3367 anchors, 18 MB | +| 3 Colors | photo-like | 1 | 0.07 s, 9 paths, 3367 anchors, 18 MB | | 3 Colors | four-colour badge | 1 | 0.05 s, 4 paths, 88 anchors, 13 MB | | 6 Colors | photo-like | 1 | 0.08 s, 78 paths, 9008 anchors, 24 MB | | 6 Colors | four-colour badge | 1 | 0.05 s, 5 paths, 84 anchors, 12 MB | -| 16 Colors | photo-like | 1 | 0.10 s, 178 paths, 20466 anchors, 31 MB | +| 16 Colors | photo-like | 1 | 0.11 s, 178 paths, 20466 anchors, 31 MB | | 16 Colors | four-colour badge | 1 | 0.05 s, 5 paths, 88 anchors, 12 MB | -| Shades of Gray | photo-like | 1 | 0.08 s, 81 paths, 6698 anchors, 41 MB | -| Shades of Gray | four-colour badge | 1 | 0.06 s, 10 paths, 733 anchors, 34 MB | +| Shades of Gray | photo-like | 1 | 0.08 s, 81 paths, 6698 anchors, 42 MB | +| Shades of Gray | four-colour badge | 1 | 0.06 s, 10 paths, 733 anchors, 35 MB | | Black and White Logo | photo-like | 1 | 0.04 s, 71 paths, 5047 anchors, 8 MB | | Black and White Logo | four-colour badge | 1 | 0.02 s, 1 paths, 47 anchors, 6 MB | | Sketched Art | photo-like | 1 | 0.04 s, 5 paths, 2880 anchors, 8 MB | @@ -306,65 +332,76 @@ One trace at a time on this machine (all cores); memory is the peak allocated ab | Line Art | four-colour badge | 1 | 0.02 s, 1 paths, 38 anchors, 6 MB | | Technical Drawing | photo-like | 1 | 0.04 s, 221 paths, 6443 anchors, 8 MB | | Technical Drawing | four-colour badge | 1 | 0.02 s, 1 paths, 47 anchors, 6 MB | +| Outline | photo-like | 1 | 0.05 s, 45 paths, 3875 anchors, 16 MB | +| Outline | four-colour badge | 1 | 0.03 s, 1 paths, 38 anchors, 11 MB | | Flat Logo | photo-like | 1 | refused after 0.09 s (not flat art), 40 MB | | Flat Logo | four-colour badge | 1 | 0.65 s, 5 paths, 78 anchors, 146 MB | | Default | photo-like | 4 | 0.18 s, 48 paths, 15720 anchors, 49 MB | | Default | four-colour badge | 4 | 0.09 s, 3 paths, 72 anchors, 48 MB | -| High Fidelity Photo | photo-like | 4 | 0.69 s, 4475 paths, 341272 anchors, 634 MB | -| High Fidelity Photo | four-colour badge | 4 | 0.23 s, 6 paths, 200 anchors, 93 MB | -| Low Fidelity Photo | photo-like | 4 | 0.35 s, 304 paths, 61093 anchors, 401 MB | -| Low Fidelity Photo | four-colour badge | 4 | 0.22 s, 6 paths, 152 anchors, 94 MB | -| 3 Colors | photo-like | 4 | 0.27 s, 20 paths, 8453 anchors, 73 MB | -| 3 Colors | four-colour badge | 4 | 0.18 s, 4 paths, 122 anchors, 53 MB | -| 6 Colors | photo-like | 4 | 0.26 s, 115 paths, 23128 anchors, 83 MB | +| Auto Color | photo-like | 4 | 0.44 s, 1469 paths, 148161 anchors, 89 MB | +| Auto Color | four-colour badge | 4 | 0.18 s, 5 paths, 92 anchors, 46 MB | +| High Fidelity Photo | photo-like | 4 | 0.70 s, 4475 paths, 341272 anchors, 634 MB | +| High Fidelity Photo | four-colour badge | 4 | 0.21 s, 6 paths, 200 anchors, 97 MB | +| Low Fidelity Photo | photo-like | 4 | 0.36 s, 304 paths, 61093 anchors, 401 MB | +| Low Fidelity Photo | four-colour badge | 4 | 0.23 s, 6 paths, 152 anchors, 97 MB | +| 3 Colors | photo-like | 4 | 0.26 s, 20 paths, 8453 anchors, 73 MB | +| 3 Colors | four-colour badge | 4 | 0.18 s, 4 paths, 122 anchors, 51 MB | +| 6 Colors | photo-like | 4 | 0.26 s, 115 paths, 23128 anchors, 100 MB | | 6 Colors | four-colour badge | 4 | 0.18 s, 5 paths, 92 anchors, 46 MB | -| 16 Colors | photo-like | 4 | 0.29 s, 353 paths, 52749 anchors, 109 MB | +| 16 Colors | photo-like | 4 | 0.28 s, 353 paths, 52749 anchors, 124 MB | | 16 Colors | four-colour badge | 4 | 0.18 s, 5 paths, 96 anchors, 46 MB | -| Shades of Gray | photo-like | 4 | 0.28 s, 138 paths, 18794 anchors, 158 MB | -| Shades of Gray | four-colour badge | 4 | 0.26 s, 10 paths, 1265 anchors, 137 MB | -| Black and White Logo | photo-like | 4 | 0.20 s, 208 paths, 13717 anchors, 32 MB | +| Shades of Gray | photo-like | 4 | 0.29 s, 138 paths, 18794 anchors, 157 MB | +| Shades of Gray | four-colour badge | 4 | 0.26 s, 10 paths, 1265 anchors, 134 MB | +| Black and White Logo | photo-like | 4 | 0.18 s, 208 paths, 13717 anchors, 32 MB | | Black and White Logo | four-colour badge | 4 | 0.08 s, 1 paths, 57 anchors, 24 MB | -| Sketched Art | photo-like | 4 | 0.17 s, 9 paths, 5358 anchors, 32 MB | +| Sketched Art | photo-like | 4 | 0.18 s, 9 paths, 5358 anchors, 32 MB | | Sketched Art | four-colour badge | 4 | 0.08 s, 2 paths, 196 anchors, 24 MB | -| Silhouettes | photo-like | 4 | 0.19 s, 2 paths, 1457 anchors, 36 MB | +| Silhouettes | photo-like | 4 | 0.18 s, 2 paths, 1457 anchors, 36 MB | | Silhouettes | four-colour badge | 4 | 0.08 s, 1 paths, 28 anchors, 24 MB | -| Line Art | photo-like | 4 | 0.18 s, 127 paths, 11461 anchors, 32 MB | +| Line Art | photo-like | 4 | 0.19 s, 127 paths, 11461 anchors, 32 MB | | Line Art | four-colour badge | 4 | 0.08 s, 1 paths, 42 anchors, 24 MB | | Technical Drawing | photo-like | 4 | 0.18 s, 931 paths, 21061 anchors, 32 MB | | Technical Drawing | four-colour badge | 4 | 0.08 s, 1 paths, 57 anchors, 24 MB | +| Outline | photo-like | 4 | 0.23 s, 113 paths, 10455 anchors, 64 MB | +| Outline | four-colour badge | 4 | 0.12 s, 1 paths, 42 anchors, 44 MB | | Flat Logo | photo-like | 4 | refused after 0.10 s (not flat art), 40 MB | -| Flat Logo | four-colour badge | 4 | 0.68 s, 5 paths, 69 anchors, 146 MB | -| Default | photo-like | 16 | 1.08 s, 127 paths, 34766 anchors, 199 MB | -| Default | four-colour badge | 16 | 0.47 s, 3 paths, 88 anchors, 184 MB | -| High Fidelity Photo | photo-like | 16 | 3.68 s, 31125 paths, 1175671 anchors, 880 MB | +| Flat Logo | four-colour badge | 4 | 0.65 s, 5 paths, 69 anchors, 146 MB | +| Default | photo-like | 16 | 0.90 s, 127 paths, 34766 anchors, 199 MB | +| Default | four-colour badge | 16 | 0.48 s, 3 paths, 88 anchors, 184 MB | +| Auto Color | photo-like | 16 | 1.58 s, 5391 paths, 449395 anchors, 279 MB | +| Auto Color | four-colour badge | 16 | 0.83 s, 5 paths, 126 anchors, 184 MB | +| High Fidelity Photo | photo-like | 16 | 3.72 s, 31125 paths, 1175671 anchors, 880 MB | | High Fidelity Photo | four-colour badge | 16 | 1.05 s, 6 paths, 274 anchors, 257 MB | -| Low Fidelity Photo | photo-like | 16 | 1.78 s, 2036 paths, 181832 anchors, 754 MB | -| Low Fidelity Photo | four-colour badge | 16 | 1.07 s, 6 paths, 187 anchors, 257 MB | -| 3 Colors | photo-like | 16 | 1.17 s, 76 paths, 22878 anchors, 290 MB | -| 3 Colors | four-colour badge | 16 | 0.82 s, 4 paths, 190 anchors, 205 MB | -| 6 Colors | photo-like | 16 | 1.09 s, 470 paths, 60539 anchors, 298 MB | -| 6 Colors | four-colour badge | 16 | 0.81 s, 5 paths, 126 anchors, 184 MB | -| 16 Colors | photo-like | 16 | 1.09 s, 1973 paths, 145173 anchors, 303 MB | -| 16 Colors | four-colour badge | 16 | 0.83 s, 5 paths, 128 anchors, 184 MB | -| Shades of Gray | photo-like | 16 | 1.61 s, 686 paths, 53872 anchors, 407 MB | -| Shades of Gray | four-colour badge | 16 | 1.35 s, 9 paths, 2216 anchors, 270 MB | -| Black and White Logo | photo-like | 16 | 1.01 s, 1128 paths, 45117 anchors, 129 MB | +| Low Fidelity Photo | photo-like | 16 | 1.75 s, 2036 paths, 181832 anchors, 754 MB | +| Low Fidelity Photo | four-colour badge | 16 | 1.04 s, 6 paths, 187 anchors, 257 MB | +| 3 Colors | photo-like | 16 | 1.11 s, 76 paths, 22878 anchors, 290 MB | +| 3 Colors | four-colour badge | 16 | 0.81 s, 4 paths, 190 anchors, 205 MB | +| 6 Colors | photo-like | 16 | 1.12 s, 470 paths, 60539 anchors, 298 MB | +| 6 Colors | four-colour badge | 16 | 0.79 s, 5 paths, 126 anchors, 184 MB | +| 16 Colors | photo-like | 16 | 1.10 s, 1973 paths, 145173 anchors, 303 MB | +| 16 Colors | four-colour badge | 16 | 0.81 s, 5 paths, 128 anchors, 184 MB | +| Shades of Gray | photo-like | 16 | 1.56 s, 686 paths, 53872 anchors, 407 MB | +| Shades of Gray | four-colour badge | 16 | 1.30 s, 9 paths, 2216 anchors, 270 MB | +| Black and White Logo | photo-like | 16 | 1.10 s, 1128 paths, 45117 anchors, 129 MB | | Black and White Logo | four-colour badge | 16 | 0.36 s, 1 paths, 69 anchors, 88 MB | -| Sketched Art | photo-like | 16 | 0.99 s, 15 paths, 11568 anchors, 128 MB | -| Sketched Art | four-colour badge | 16 | 0.39 s, 2 paths, 361 anchors, 88 MB | -| Silhouettes | photo-like | 16 | 1.30 s, 3 paths, 3358 anchors, 144 MB | +| Sketched Art | photo-like | 16 | 0.94 s, 15 paths, 11568 anchors, 128 MB | +| Sketched Art | four-colour badge | 16 | 0.37 s, 2 paths, 361 anchors, 88 MB | +| Silhouettes | photo-like | 16 | 1.31 s, 3 paths, 3358 anchors, 144 MB | | Silhouettes | four-colour badge | 16 | 0.41 s, 1 paths, 32 anchors, 95 MB | -| Line Art | photo-like | 16 | 0.95 s, 713 paths, 36212 anchors, 129 MB | -| Line Art | four-colour badge | 16 | 0.34 s, 1 paths, 49 anchors, 88 MB | -| Technical Drawing | photo-like | 16 | 1.09 s, 4578 paths, 79049 anchors, 130 MB | -| Technical Drawing | four-colour badge | 16 | 0.37 s, 1 paths, 69 anchors, 88 MB | -| Flat Logo | photo-like | 16 | refused after 0.11 s (not flat art), 40 MB | -| Flat Logo | four-colour badge | 16 | 0.67 s, 5 paths, 67 anchors, 146 MB | +| Line Art | photo-like | 16 | 1.01 s, 713 paths, 36212 anchors, 129 MB | +| Line Art | four-colour badge | 16 | 0.35 s, 1 paths, 49 anchors, 88 MB | +| Technical Drawing | photo-like | 16 | 1.14 s, 4578 paths, 79049 anchors, 130 MB | +| Technical Drawing | four-colour badge | 16 | 0.36 s, 1 paths, 69 anchors, 88 MB | +| Outline | photo-like | 16 | 1.28 s, 632 paths, 31715 anchors, 256 MB | +| Outline | four-colour badge | 16 | 0.55 s, 1 paths, 49 anchors, 176 MB | +| Flat Logo | photo-like | 16 | refused after 0.12 s (not flat art), 40 MB | +| Flat Logo | four-colour badge | 16 | 0.66 s, 5 paths, 67 anchors, 146 MB | ## Revision history | date | change | |:--|:--| +| 2026-10-13 | Ignore Color; the Auto Color and Outline presets, measured from here on (Outline is the first measure of Create: Strokes) | | 2026-10-13 | Thin lines: black and white read against the image's darkest black and the paper near each edge | | 2026-10-13 | Memory: layers traced within the box of their pixels and a few at a time (16 megapixel photo: 3.9 GB to 0.9 GB) | | 2026-10-13 | Shared edges: outlines are cut at their junctions and each piece is fitted once, the same from either side |