Image to SVG (Block Trace)

This converter turns an image into an SVG built from small rectangles: it samples the picture on a 2-pixel grid and, wherever a sample is darker than your threshold, writes a 2×2 block into the file. The result scales without blurring and opens in any vector editor, but it is a mosaic rather than a traced outline — there are no Bezier curves and no paths to drag. High-contrast silhouettes, stencils, simple icons and lettering come out useful; photographs and detailed logos do not.

Block trace, outline trace and hand tracing

MethodWhat ends up in the fileEditable as pathsSuited to
Block trace (this page)One black <rect> per dark 2×2 blockNo — thousands of separate rectanglesTwo-tone silhouettes, stencils, blocky icons
Outline traceA handful of Bezier paths per shapeYesLogos, line art, signatures, maps
Hand tracingPaths drawn by a personYes, preciselyAnything that has to be exact
Keeping the PNGPixelsNot applicablePhotographs and anything with soft gradients
🖼️

Upload image or drag & drop

PNG / JPG / GIF — simple shapes work best

How the block trace builds the file

The first step is a downscale. The image is drawn to a canvas no wider than 800 pixels, so a 3000-pixel-wide source is reduced before any sampling happens — the output resolution is capped by that 800-pixel ceiling, not by your original file.

Then the canvas is read on a 2-pixel grid. For each sample the tool averages the red, green and blue channels into one grey value and compares it with the threshold slider, which runs from 0 to 255 and starts at 128. If the sample is transparent it is skipped; if it is darker than the threshold, one line of SVG is appended — a 2×2 rectangle filled black at that x and y. Everything else stays empty, so the background of the exported file is transparent rather than white.

That 2-pixel step is the whole design. An 800×600 image becomes a 400×300 grid, or 120,000 possible cells; a typical silhouette covers a quarter to a third of them, which is 30,000 to 40,000 rectangles. Every one of those is independent: no rectangle is merged with its neighbour, and no edge is shared. The output therefore looks like fine graph paper when you zoom in, and each rectangle can be selected and moved on its own.

Why the SVG is often bigger than the PNG you started with

A single rectangle costs roughly 55 characters of markup, so 35,000 of them come to about 1.9 MB of text before any compression. A flat two-tone PNG of the same picture is often 40–150 KB. The converter is therefore a format trade, not a size optimisation: you gain infinite scaling and editability at the block level, and you pay for it in file size.

That is not a flaw in the implementation so much as a property of this approach. An outline tracer would store one path per shape and reach a few kilobytes because it describes boundaries rather than filling area. If your goal is a smaller asset, convert the image to WebP or AVIF instead; if your goal is a file a cutting machine can use, export a block trace or a real outline trace, not a PNG.

What a real vectorizer does, and what this page does not

Outline tracing works in three stages. It walks the boundary between dark and light regions to collect the exact contour pixels (a marching-squares pass), simplifies each contour by dropping points that sit close to a straight line, and finally fits cubic Bezier curves through what remains. The result is a small number of smooth paths that look identical at any scale. Separately, colour vectorizers quantize the image into a fixed palette first, then trace one layer per palette entry.

This page does none of that. There is no contour walk, no curve fitting and no colour layering: the slider labelled Color Count is read by the script but does not currently influence the output, which is always black blocks on a transparent background. That is a known limitation rather than an intended feature, and it is stated here so you do not spend time looking for a setting that would change it.

In practice, use the block trace for things that are already two-tone — a stencil cut from card, a stamp, a bold icon that will be printed small, a silhouette for a vinyl cutter where 2-pixel stair-steps disappear at cutting size. For a logo that must survive being enlarged to a billboard, or line art that a designer will edit, the source needs to be re-drawn or traced with an outline tracer; a block trace will hand back tens of thousands of squares instead of a handful of curves.

Frequently asked questions

No. It is a mosaic of 2×2 rectangles in an SVG wrapper. It is genuinely vector — it scales without pixelation and every element is a shape — but it is not a traced outline, so it will not give you smooth curves to edit.

Each block is a separate line of markup of about 55 characters, and a typical image needs tens of thousands of them. A 1–2 MB SVG against a 100 KB PNG is normal. Outline tracers avoid this by storing a few paths instead of filling every area with squares.

Not currently. The value is read by the script but the drawing loop only ever emits black blocks, which is why the output stays monochrome whether you set 2 or 16. The control is kept in the interface for a planned multi-colour version.

High-contrast, two-tone subjects: silhouettes, stencils, stamps, bold lettering, simple pictograms. Photographs and gradients turn into noise, because every intermediate grey has to be forced to either black or nothing at the threshold.

It opens, and every rectangle is individually selectable, but do not expect a tidy object tree: you will see thousands of separate squares rather than a few closed paths. Editing is practical for deleting stray blocks, not for reshaping a logo.

The image is downscaled to at most 800 pixels wide before sampling, so the finest detail in the SVG is 2 pixels of that reduced image, not of your original. Threshold sets the cut-off between black and empty, from 0 to 255 with 128 as the default; lower values keep fewer blocks, higher values keep more.