Image
No image loaded.
SVG
Palette
Warnings
Options
Large photos are scaled down to keep conversion quick. Leave the longest side empty to keep the input size.
Size
Colours
Cleanup
Tracing
Smoothing
Paint order and output
How this works
The converter groups pixels into colours, traces their regions and smooths the outlines. Its source is available on GitHub.
- Colours. Colours are rounded, and the most frequent are clustered by weighted k-means with k-means++ starts. Every pixel takes its nearest centre. With k automatic, the k with the lowest Davies–Bouldin index wins.
- Cleanup. Runs of fewer pixels than the shortest run kept are absorbed into the next run, along rows and then columns.
- Tracing. Each colour's regions become closed outlines on the pixel corners. Marching squares follows every pixel edge. The chain tracer detects edges, thins them to a one-pixel line and follows chains; it can lose regions where a boundary pinches or branches, and reports them as warnings.
- Smoothing. Each outline's x and y are smoothed as circular series: by soft thresholding of wavelet (MODWT) details, by dropping weak Fourier frequencies, or by Walsh–Hadamard thresholding.
- Paint order. A shape mostly inside another paints after it. Holes are cut where the colour filling them is transparent, or everywhere, or nowhere.
Scripts and agents can use the same converter: see the API description.