Vector Studio engine (EngineVector)
Package Packages/EngineVector, module EngineVector, engine id vector, factory makeEngines().
No third-party code: the tracer is written in Swift for this project (no Potrace, autotrace or vtracer code);
it uses ImageIO, Core Graphics, Accelerate (vImage un-premultiplication), Core Text only in tests, and WebKit for
rendering general SVG files.
Everything below was measured on 2026-11-21 on this Mac (Apple M5 Max, 18 cores, macOS 27.0, Swift 6.4.2).
Test summary: swift test → 54 tests in 8 suites passed (✔ Test run with 54 tests in 8 suites passed after 128.374 seconds, 2026-11-21, debug build, load average about 30 on 18 cores; 53 run, the benchmark is skipped unless
ORIX_VECTOR_BENCH=1).
Declared paths (26)
Limitations shown to the user (T = tracing, R = rendering):
- T1 The drawing is an approximation made of flat colour shapes: gradients, textures and photographs become bands of colour.
- T2 Partial transparency is not kept: every shape is opaque.
- T3 Only the first frame of an animated or multi-page image is traced.
- T4 Text becomes outlines; it is not recognised as text.
- T5 Metadata and colour profiles are not carried over (colours are converted to sRGB).
- R1 Scripts and event handlers in the SVG are not executed.
- R2 Animations are not played: the drawing is rendered in its initial state.
- R3 External references (linked images, fonts, style sheets, other files) are not loaded.
- R4 Text uses the fonts installed on this Mac; a missing font is replaced.
- R5 Filter effects, masks and embedded bitmaps can be stored as images inside the PDF.
- R6 The PDF page is opaque: the drawing is placed on white, or on the chosen background colour.
- R7 The drawing becomes pixels (at most 8192 per side).
- R8 JPEG has no transparency: the drawing is placed on a background colour.
| Source | Destination | Operation | Status | Fidelity | Preserves | Limitations | Test (EngineTests.swift) |
|---|---|---|---|---|---|---|---|
| png | svg | image.vectorize |
supported | lossy | transparency, dimensions | T1–T5 | tracesEverySource("png") |
| png | image.vectorize |
supported | lossy | transparency, dimensions | T1–T5 | tracesEverySource("png") |
|
| jpeg | svg | image.vectorize |
supported | lossy | transparency, dimensions | T1–T5 | tracesEverySource("jpeg") |
| jpeg | image.vectorize |
supported | lossy | transparency, dimensions | T1–T5 | tracesEverySource("jpeg") |
|
| tiff | svg | image.vectorize |
supported | lossy | transparency, dimensions | T1–T5 | tracesEverySource("tiff") |
| tiff | image.vectorize |
supported | lossy | transparency, dimensions | T1–T5 | tracesEverySource("tiff") |
|
| bmp | svg | image.vectorize |
supported | lossy | transparency, dimensions | T1–T5 | tracesEverySource("bmp") |
| bmp | image.vectorize |
supported | lossy | transparency, dimensions | T1–T5 | tracesEverySource("bmp") |
|
| gif | svg | image.vectorize |
supported | lossy | transparency, dimensions | T1–T5 | tracesEverySource("gif") |
| gif | image.vectorize |
supported | lossy | transparency, dimensions | T1–T5 | tracesEverySource("gif") |
|
| heic | svg | image.vectorize |
supported | lossy | transparency, dimensions | T1–T5 | tracesEverySource("heic") |
| heic | image.vectorize |
supported | lossy | transparency, dimensions | T1–T5 | tracesEverySource("heic") |
|
| webp | svg | image.vectorize |
supported | lossy | transparency, dimensions | T1–T5 | tracesEverySource("webp") |
| webp | image.vectorize |
supported | lossy | transparency, dimensions | T1–T5 | tracesEverySource("webp") |
|
| avif | svg | image.vectorize |
supported | lossy | transparency, dimensions | T1–T5 | tracesEverySource("avif") |
| avif | image.vectorize |
supported | lossy | transparency, dimensions | T1–T5 | tracesEverySource("avif") |
|
| jp2 | svg | image.vectorize |
supported | lossy | transparency, dimensions | T1–T5 | tracesEverySource("jp2") |
| jp2 | image.vectorize |
supported | lossy | transparency, dimensions | T1–T5 | tracesEverySource("jp2") |
|
| tga | svg | image.vectorize |
supported | lossy | transparency, dimensions | T1–T5 | tracesEverySource("tga") |
| tga | image.vectorize |
supported | lossy | transparency, dimensions | T1–T5 | tracesEverySource("tga") |
|
| psd | svg | image.vectorize |
supported | lossy | transparency, dimensions | T1–T5 | tracesEverySource("psd") |
| psd | image.vectorize |
supported | lossy | transparency, dimensions | T1–T5 | tracesEverySource("psd") |
|
| svg | – | supported | structural | vectorGeometry, dimensions, textStyles | R1–R6 | svgToVectorPDF, scriptsAreNotExecutedAndRemoteReferencesAreNeverFetched |
|
| svg | png | – | supported | lossy | transparency, dimensions | R1–R4, R7 | svgToBitmapsWithScaleAndAlpha, tracedSVGRendersTheSameInWebKit |
| svg | tiff | – | supported | lossy | transparency, dimensions | R1–R4, R7 | svgToBitmapsWithScaleAndAlpha |
| svg | jpeg | – | supported | lossy | dimensions | R1–R4, R7, R8 | svgToBitmapsWithScaleAndAlpha |
tracesEverySource is a parameterised test: for each of the 11 source formats it encodes a fixture with ImageIO
(WebP: the bundled 198-byte Tests/EngineVectorTests/Fixtures/shapes.webp, because ImageIO cannot encode WebP),
converts it to SVG and to PDF through VectorEngine.convert, runs validate, parses the SVG back, re-rasterises it
and compares it with the decoded source (mean absolute error < 2.5 / 255), and checks that the PDF has one page of
the expected size and no image object.
Raster formats ImageIO decodes on this Mac that are not declared, because no test feeds them through the tracer:
HEIF (.heif), JPEG XL, ICO/CUR, ICNS, OpenEXR, Radiance HDR, PBM/PGM/PPM, DNG and camera RAW, DICOM, KTX/ASTC/DDS/PVR,
SGI, PICT, MPO. The decoder would accept them; they are simply not claimed.
What the output is
- SVG: one
<path>per colour,viewBox="0 0 W H"in source pixels,fill-rule="nonzero", optional<rect>background. Never an<image>element, never base64 data —validateand every test check this on the file text. - PDF (tracing): the same geometry filled through a Core Graphics PDF context;
PDFInspector(CGPDFScanner, following form XObjects) confirms path-painting operators and zero image XObjects. - Facts returned with every trace:
paths,subpaths,nodes,lines,curves,colors,regions,svgBytes,content.kind,content.significantColors,content.colorEntropyBits,traceSeconds,threshold(monochrome modes) and the measured similarity:similarity.meanDeltaE(OKLab × 100),similarity.meanAbsoluteError(0–255),similarity.meanAlphaError,similarity.matchingPixels,similarity.edgeRecall,similarity.edgePrecision,similarity.comparedAt. The similarity is computed by rasterising the drawing with Core Graphics and comparing it pixel by pixel with the source (above 4 megapixels both are reduced first). When the background was removed, both images are compared over the removed colour.
Pipeline
flowchart TD
A[ImageIO decode<br/>bounded pixels, EXIF orientation, sRGB] --> B[Transparency + background analysis<br/>content analysis: entropy, flat / gradient fractions]
B --> C[Preprocess<br/>flatten alpha? median 3x3 / bilateral 5x5? enlarge?]
C --> D{Mode}
D -- monochrome modes --> E[Threshold<br/>Otsu or manual, optional contrast stretch]
D -- multicolour modes --> F[Palette in OKLab<br/>blend-pixel map, 18-bit histogram,<br/>variance median cut -> weighted k-means, near-duplicate merge]
F --> G[Blend pixels take a neighbouring region's label]
E --> H[4-connected components]
G --> H
H --> I[Merge regions below the minimum area<br/>into the most similar neighbour<br/>auto-coarsen above the region cap]
I --> J[Background removal?]
J --> K[Crack-following contours<br/>cut at junctions: every boundary piece exists once]
K --> L[Sub-pixel placement from anti-aliasing coverage<br/>step samples dropped, image corners pinned]
L --> M[Corner detection -> RDP polygon -> straight runs<br/>least-squares lines, corners by intersection]
M --> N[Schneider least-squares cubic fitting<br/>with reparameterisation, balanced splits]
N --> O[Layer assembly<br/>stacked or cut-out, loops of whole chains]
O --> P[SVG writer: relative commands, minimal numbers]
O --> Q[CGPath / vector PDF]
P --> R[Read back + geometry validation]
Q --> S[Rasterise + measured similarity]
- Load (
RasterDecoder): header first; images above 16384² pixels or 2 GB are refused; images above the tracing limit (4096² pixels) are decoded sub-sampled; EXIF/TIFF orientation 1–8 applied; colours converted to sRGB.SourceAnalysis.transparencyreports opaque / transparent / partial fractions, translucent interiors and whether the border is transparent, one colour, or mixed. - Preprocess (
Preprocess): optional 3 × 3 median or 5 × 5 bilateral denoising (row-parallel), optional bilinear enlargement, alpha flattening on request. Colour decisions are made in OKLab. - Quantisation (
Quantizer). Monochrome modes: brightness threshold, Otsu or manual, optional 1–99 percentile contrast stretch; the paper is the class that dominates the border; a single-tone shape on a transparent background is thresholded on alpha. Multicolour: pixels whose colour lies between two opposite neighbours are flagged as anti-aliasing blends and kept out of the palette; the palette is a weighted k-means over an 18-bit histogram, seeded deterministically by a variance-based median cut (no random numbers); centroids closer than a perceptual threshold are merged, so the colour count is an upper bound. Blend pixels then take the label of a neighbouring settled region (closest in sRGB), so an edge never becomes a sliver of a third colour. Edge sensitivity drives the blend test, the merge threshold and the bilateral range. - Segmentation (
Segmenter): two-pass union–find components; regions below the minimum area are merged into the neighbour with the closest palette colour (ties: longest shared boundary). AbovemaximumRegions(20 000) the minimum area is doubled up to eight times, with aregions-coarsenedwarning, then the trace is refused. - Contours (
ContourTracer): boundaries are followed along pixel edges and cut at every vertex where three or more regions meet. Each piece ("chain") is traced, placed and fitted once and reused by both neighbours, so shared boundaries are identical by construction. Each sample is moved off the grid by the coverage of the two pixels it separates (projection of the pixel colour on the axis between the two region colours, in premultiplied RGBA; brightness remapped around the threshold in monochrome modes). Samples on "step" cracks, where that two-pixel estimate is poor, are dropped. Junctions get a sub-pixel position from their incident cracks. Corners of the image are inserted exactly. - Corners and fitting (
CurveFitter): corners from the windowed turning angle (threshold from curve smoothness); between corners a Ramer–Douglas–Peucker polygon finds candidate straight runs, accepted when a total-least-squares line fits and the quadratic bow of the samples is negligible; lines are then trimmed where the samples leave them, and corners between two lines are restored by intersecting the lines (this recovers corners that anti-aliasing blunts). Curved runs are fitted with cubic Béziers by least squares after Schneider (Graphics Gems, 1990), with Newton reparameterisation continued while it improves the fit, near-balanced splits and a size-relative tolerance. A cubic that is flat is written as a line. - Simplification / precision: path simplification widens the RDP and line tolerances and the fitting tolerance (it does not subsample the points handed to the fitter: that produced bulges between the kept points and was removed). Coordinates are rounded to 0–3 decimals; relative deltas are differences of rounded absolute values, so rounding never accumulates.
- Layers and SVG (
LayerBuilder,SVGWriter): colours are painted back to front (largest area first). In the default stacked layout a layer also extends under the adjacent regions painted later, so no anti-aliasing seam can show the canvas between two shapes; cut-out gives each shape exactly its own area. One<path>per colour,M/m,h,v,l,c,z, implicit command repetition, no leading zeros, minimal separators. - Validation (
TracedSVGReader): XML + path-data parser; checks closed contours, finite numbers, true curve bounds inside the viewBox (extrema of each cubic, not its control polygon), no<image>, nohref. - Preview / similarity (
VectorDocument.cgLayers,makeImage,Similarity).
Modes and controls
Modes are presets over the same controls (VectorSettings.preset(_:)): Logo, Line art, Monochrome, Multicolour
illustration, Icon, Technical drawing, High-detail tracing. An option absent from a request takes the value of the
request's mode; VectorEngine.presetOptions(for:) returns a mode's values for the settings panel.
Option keys: mode, colors, threshold.mode, threshold, edge.sensitivity, curve.smoothness, simplify,
region.min, background.remove (keep / remove / remove-all), transparency (preserve / white /
black), detail, precision, background.color, denoise, upscale, contrast.normalize, composition
(stacked / cutout), ink.color, similarity.measure, and pdf.dpi for the PDF destination. SVG rendering:
scale, resize.width, resize.height, background, dpi, quality (JPEG).
Public API for the app (Vector Studio live preview)
Vectorizer().trace(_ image: CGImage, settings:, quality: .full | .preview(maxDimension:), documentSize:, measureSimilarity:, progress:, isCancelled:) (synchronous, with a cancellation closure) and an async variant that
honours task cancellation. VectorResult carries the SVG string, the VectorDocument (cgLayers gives a
CGPath + CGColor per layer in source-pixel coordinates; makeImage, pdfData), VectorStatistics
(paths, nodes, bytes, per-stage seconds), TransparencyAnalysis, ContentAnalysis, the optional
SimilarityMeasure and warnings.
Measured accuracy (from the tests)
| Fixture | Assertion that passes |
|---|---|
| Anti-aliased discs, radius 80.3 / 20 / 110, off-grid centres | ≤ 8 cubic segments, max radial error < 0.3 px, mean < 0.1 px |
| Hard-edged disc, radius 80.3 | max radial error < 0.75 px (the pixel grid's own uncertainty is 0.5 px) |
| Anti-aliased rectangle (edges at .25/.5/.75) + triangle | only line segments, ≤ 9 nodes, every corner within 0.15 px |
| Hard-edged rectangle + triangle, Technical mode | only line segments, ≤ 8 nodes, corners within 1 px |
| Ring | 2 contours of opposite orientation, areas within 1 %, centre empty after re-rasterising (non-zero and even-odd) |
| Flat illustration, Voronoi cells, checkerboard | stacked drawing rasterised at 2–3× has no pixel with alpha < 255 |
| Traced SVG rendered by WebKit (independent renderer) | mean absolute error < 1 / 255 vs the source, fully opaque |
| Re-rasterised SVG vs source, mean absolute error (0–255) | disc < 0.25, ring < 0.4, polygons < 0.1, text < 0.6, thin lines < 1.5, illustration < 0.6, icon < 0.4, hard-edged shapes < 1.2 |
Measured performance
ORIX_VECTOR_BENCH=1 swift test -c release --filter Benchmark (optimised build; fixtures drawn in code; the Mac was
running other sessions at the time, and times varied by up to ± 40 % between runs). "Trace" excludes decoding and the
similarity pass.
| Fixture | Source | Traced | Trace s (best of 3) | Trace + similarity s | Paths | Nodes | SVG bytes | Mean ΔE | Stage ms |
|---|---|---|---|---|---|---|---|---|---|
| Logo, mode Logo | 1024 × 1024 | 1024 × 1024 | 0.032 | 0.036 | 3 | 96 | 2276 | 0.021 | prepare 2, quantize 16, segment 8, contours 5, fit 1, assemble 0 |
| Logo, mode Logo | 2048 × 2048 | 2048 × 2048 | 0.124 | 0.138 | 3 | 105 | 2646 | 0.011 | prepare 6, quantize 66, segment 32, contours 19, fit 2, assemble 0 |
| Logo, mode Logo | 4096 × 4096 | 4096 × 4096 | 0.479 | 0.493 | 3 | 128 | 3411 | 0.039 | prepare 20, quantize 259, segment 131, contours 65, fit 3, assemble 0 |
| Logo, mode Monochrome | 4096 × 4096 | 4096 × 4096 | 0.420 | 0.478 | 1 | 150 | 4097 | 4.108 | prepare 19, quantize 70, segment 263, contours 66, fit 3, assemble 0 |
| Logo, preview pass (512) | 4096 × 4096 | 512 × 512 | 0.010 | 0.012 | 3 | 118 | 2798 | 0.083 | prepare 1, quantize 5, segment 2, contours 1, fit 0, assemble 0 |
| Flat illustration, mode Multicolour | 1024 × 1024 | 1024 × 1024 | 0.022 | 0.026 | 5 | 50 | 1190 | 0.016 | prepare 2, quantize 9, segment 8, contours 4, fit 0, assemble 0 |
| Flat illustration, mode Multicolour | 2048 × 2048 | 2048 × 2048 | 0.089 | 0.104 | 5 | 56 | 1385 | 0.010 | prepare 6, quantize 35, segment 33, contours 17, fit 1, assemble 0 |
| Flat illustration, mode Multicolour | 4096 × 4096 | 4096 × 4096 | 0.346 | 0.383 | 5 | 61 | 1627 | 0.019 | prepare 23, quantize 138, segment 130, contours 62, fit 1, assemble 0 |
| Photo-like, mode Multicolour (16 colours) | 1024 × 1024 | 1024 × 1024 | 0.144 | 0.208 | 16 | 26802 | 459167 | 5.523 | prepare 3, quantize 85, segment 44, contours 9, fit 6, assemble 12 |
| Logo, Line art + median denoise | 2048 × 2048 | 2048 × 2048 | 0.130 | 0.216 | 1 | 189 | 4621 | 4.080 | prepare 13, quantize 20, segment 81, contours 19, fit 2, assemble 0 |
In a debug build (swift test without -c release) the same code is much slower: since 2026-11-21 the whole test suite takes about two minutes in debug on a loaded Mac, most of it in the 324-image canvas test and the two files above the tracing limit (it took 20–40 s before those were added).
The photo-like row is the honest picture of what tracing a photograph gives: 16 colours, about 27 000 path
segments, a 459 KB SVG for a 1024² source, and a mean ΔE above 5. preflight warns about it before converting
(photographic-content) and convert repeats the warning.
Enlarging small sources before tracing was evaluated and is off by default: on 16–64 pixel icons and text it produced 2–8 × more nodes without lowering the error (e.g. 64-pixel icon: mean absolute error 0.13 with 12 nodes at 1 ×, 0.22 with 130 nodes at 2 ×, 0.22 with 340 nodes at 4 ×). The first version used Lanczos (vImage), whose ringing next to hard edges was traced as specks; the option now uses bilinear interpolation.
SVG rendering (general SVG files)
There is no public Core Graphics API for SVG, so SVGWebRenderer (@MainActor) uses an off-screen WKWebView:
- the SVG is shown as
<img src="data:image/svg+xml;base64,…">inside a page generated by the engine — in that mode WebKit neither runs the SVG's scripts nor loads its external resources; allowsContentJavaScript = false, non-persistent data store;- a compiled
WKContentRuleListblocks every request exceptabout:anddata:(three rules: block.*, thenignore-previous-rulesfor^about:and for^data:). Fixed 2026-11-21: the list used the single filter^(about|data):; WebKit's content-rule regular expressions have no disjunction, the compilation failed and atry?dropped the list, so it had never been installed (the other layers still blocked everything). The list is now mandatory: a compilation failure makes the rendering fail (SVGRenderError.renderFailed), it is never skipped; Content-Security-Policy: default-src 'none'; img-src data:; style-src 'unsafe-inline';- the navigation delegate allows only the initial
about:blankload.
Tests: contentRuleListCompilesAndIsInstalled (the list compiles, is in the store, is attached to every web view,
and the old disjunction source is a hard error) and eachNetworkLayerBlocksOnItsOwn: a probe page that references a
remote image, stylesheet, script and video on a local counting listener reaches it when the rule list and the
policy are both off (positive control), and makes 0 connections with the rule list alone (no policy, JavaScript
allowed), with the Content-Security-Policy alone, and with everything on.
createPDF gives the vector PDF (page size in points = SVG size × 0.75 × scale, or the requested width/height);
takeSnapshot gives bitmaps. A snapshot has snapshotWidth × backing scale pixels (2 on this Mac), so the renderer
asks for the width that yields exactly the requested pixels and re-renders at that size (the test checks a 3 ×
render has a ≤ 2-pixel edge, i.e. it is not an enlarged small bitmap). WebKit snapshots are opaque: for a
transparent PNG/TIFF the SVG is rendered once over white and once over black and alpha is recovered from the
difference.
The test scriptsAreNotExecutedAndRemoteReferencesAreNeverFetched starts a TCP listener on 127.0.0.1, checks that it
counts a real connection, then renders (PDF, PNG, JPEG, TIFF) an SVG that references that server from <image>,
xlink:href, <use>, CSS @import, @font-face, url(), <foreignObject><img>, <script href>, fetch, an
image beacon and window.location: the listener receives no connection, and the square the script would turn
green stays red. It works inside swift test (the engine hops to the main actor; no window is created).
Intrinsic size (SVGInspector): width/height with CSS units (px, pt, pc, in, cm, mm, Q, em = 16 px, ex = 8 px),
else the viewBox, else the CSS default 300 × 150 with a svg-default-size warning.
The drawing never leaves the canvas (fixed 2026-11-21)
Defect: about 1 in 100 generated 12 MP images failed the engine's own check “A contour leaves the viewBox”.
Root cause, in the curve fitter (Fitting.swift, generate): Schneider's least-squares step solves for the two
handle lengths of a cubic from the samples of a run. A short run with a single interior sample (typically the
first samples of a boundary that starts on the border of the image, between two corners) does not determine them:
the one sample is interpolated exactly by curves whose handles are several times longer than the run, and such a
curve swings away from the polyline between the samples — where the error is not measured — by more than a pixel.
The only sanity bound was “handle ≤ 4 × chord”. On a boundary touching the border the swing went outside the image;
on images above the tracing limit one traced pixel is several document pixels, which made it visible (up to 6.5 px
on an 8000 × 6000 document in the reproduction).
Fix: (1) a handle longer than the sampled arc of its run is rejected and the Wu–Barsky chord/3 handles are used,
after which the usual error test decides whether to split — this removes the swing itself (in the 1 080-trace
reproduction: 224 drawings with a curve outside the canvas before, 3 after, all under 0.006 px); (2) the fitter
knows the canvas (FitParameters.canvas) and guarantees the invariant: a corner rebuilt by intersecting two fitted
lines is given up for its sample when it falls outside the image, and a curve whose true extent (its extrema, not
its control points) still leaves the canvas keeps its end points and handle directions and has both handles
shortened by the largest common factor that brings it back inside (CurveFitter.confined). Curves that are inside
are not touched, even with control points outside.
Tests: StageTests.shortRunsDoNotSwingBetweenTheirSamples (the real 186-sample boundary of the reproduction; fails
without fix 1), TracerLimitTests.noContourEverLeavesTheCanvas (324 generated images — the pictures of
orix-convert dev seed images — in nine sizes and three presets, a third of them traced as reduced copies of a 4×
larger document: 0 with any curve outside, tolerance 1e-9 px), EngineReductionTests (files of 4100 × 4100 and
6000 × 4000 pixels — plus 8192 × 4096 with ORIX_VECTOR_BENCH=1 — through the engine end to end: decoded reduced,
traced, validated, coordinates in the original size; the reduction path had no engine-level test before).
Run of 2026-11-21 with the release command-line tool after the fix (orix-convert dev seed images, then
orix-convert convert <folder> --recursive --to svg --operation image.vectorize, default settings, 8 jobs at once,
load average about 50 on 18 cores; every output went through the engine's validation, svg.withinViewBox included):
| Images | Size | Through the reduction path | Converted | Failed | Wall time |
|---|---|---|---|---|---|
| 100 | 4000 × 3000 (12 MP) | no | 100 | 0 | 26.2 s |
| 100 | 1500 × 1000 | no | 100 | 0 | 3.7 s |
| 100 | 800 × 1200 | no | 100 | 0 | 2.6 s |
| 16 | 6000 × 4500 (27 MP) | yes | 16 | 0 | 8.6 s |
| 8 | 8000 × 6000 (48 MP) | yes | 8 | 0 | 11.8 s |
| 8 | 4100 × 4100 (16.8 MP) | yes | 8 | 0 | 4.2 s |
| 332 | 32 | 332 | 0 |
The single failing file of the benchmark report (image-0009.png of 100) could not be reproduced with the same
command before the fix (300 conversions of freshly generated 12 MP images, 0 failures; the tracer is deterministic);
the defect was reproduced instead with the in-memory stress above, where it was frequent on reduced documents.
Limitations
- Tracing produces opaque flat fills only: no gradients, no strokes, no partial transparency, no text recognition.
- Photographs and soft shading do not become compact faithful vectors (see the benchmark row); this is detected and reported, not hidden.
- Junction points where three or more regions meet are placed from their incident edges and are less precise than ordinary boundary points (up to about half a pixel); curves are not forced to be tangent-continuous across a junction.
- In the stacked layout a boundary can be drawn by more than one layer (a lower layer extends under its neighbours), so the node count can exceed the cut-out layout's; along such boundaries a renderer can blend in a trace of the lower layer's colour in the anti-aliased pixels.
- Sub-pixel placement is disabled between regions whose pixels vary a lot around their palette colour (gradients): there the outline follows the pixel grid, smoothed.
- Without anti-aliasing (1-bit art) position accuracy is bounded by the pixel grid (≤ 0.5 px + fitting), and a straight run inside a smooth outline must be long (≥ 4 × the usual minimum) to be kept as a line.
- Very thin features (below one pixel, or lighter than 50 % coverage) disappear or break up.
- Tracing limit 4096² pixels (larger images are reduced, with a warning); bitmaps from SVG are limited to 8192 pixels per side; PDF pages to 14 400 points.
- SVG → PDF: the page is always opaque (WebKit paints white behind the content; a colour can be chosen). Filter
effects and embedded bitmaps end up as images inside the PDF;
validatereports how many. - SVG rendering depends on the WebKit of the running macOS; text needs the fonts to be installed.
- Only the first frame of animated GIF / WebP / HEIC sequences and multi-page TIFF is traced (warning
animation-first-frame).
Evaluated and NOT implemented
- Centerline / stroke tracing for line art: not implemented. Doing it properly needs skeletonisation, spur pruning, junction resolution and stroke-width estimation; a half-working version would produce broken strokes, so line art is traced as filled outlines only.
- Gradient detection / gradient fills: not implemented (flat fills only).
- EPS output: not implemented (excluded by the brief). SVG → WebP: not implemented (ImageIO cannot encode WebP).
- Compressed SVG (
.svgz): not accepted; it is reported as malformed XML. - Transparent PDF page from SVG: not possible with
WKWebView.createPDF(tested:underPageBackgroundColorhas no effect on the PDF). - Optimal-polygon (Potrace-style) corner analysis: not implemented; corners come from the turning-angle detector and line intersection described above. No Potrace code or port is included (GPL).
- Visvalingam simplification: not implemented; Ramer–Douglas–Peucker is used.
- Random k-means++ seeding: replaced by deterministic median-cut seeding so that the same input always gives the same SVG (checked within a process, across processes, and between debug and release builds).
- Raster formats listed above as decodable but untested: not declared.