SVG Color Layers
Open the tool

Guide

How to separate an SVG into color layers

One file goes in. One clean layer per color comes out, with every shape of that color merged into a single path. Here is what that means, when you need it, and how to do it in about two minutes without installing anything.

By Medo Ismail Updated August 2026 7 min read Free, runs in your browser

What color separation actually means

An SVG is a pile of shapes, and each shape carries a paint. A logo that reads as three colors is usually not three objects. It is forty or four hundred objects that happen to share three fill values, scattered across groups, wrapped in transforms, and sometimes painted by a stylesheet rather than an attribute.

Color separation means pulling that pile apart along color lines. Every shape painted red goes in one file. Every shape painted navy goes in another. Each file keeps the original canvas, so when you stack them back up you get the artwork you started with, in register, pixel for pixel.

Source file 5 shapes, 3 colors One layer per color layer-01-red.svg layer-02-navy.svg layer-03-yellow.svg Same viewBox on every layer, so they stack back into the original
Each layer keeps the full canvas and the original coordinates. Nothing is cropped or re-centred, which is what keeps the set printable.

Who needs it and why

This is one of those operations that sounds niche until you hit it, and then it blocks your whole afternoon.

Screen printing

Every ink needs its own screen, and every screen needs its own film positive. If your artwork is spot color vector, a color separation is literally the deliverable. One file per ink, all at the same size and position.

Vinyl cutting and heat transfer

Cricut, Silhouette, Cameo and Roland plotters all cut one sheet of one color at a time. Importing a three color design as three files means each color lands on its own mat with the registration intact.

Laser cutting and engraving

Most laser software maps color to operation. Cut on red, score on blue, engrave on black. Clean per color files remove the guesswork of assigning operations shape by shape.

Editing and recoloring

Trying to recolor a traced illustration by selecting shapes one at a time is misery. Once each color is a single path you can change a brand color across an entire illustration by editing one attribute.

Animation and web handoff

Animating a logo is far simpler when each color is one addressable element instead of ninety siblings. Fewer elements also means less for the browser to lay out and paint.

Embroidery and print prep

Digitizing software works from clean shape boundaries. Merged, single path color regions convert far more predictably than hundreds of overlapping slivers left behind by an auto trace.

Separating is not the same as flattening

This is the distinction most tools blur, and it is the one that decides whether the output is actually usable.

Separating gives you a file containing only the red shapes. There might still be four hundred of them, each with its own transform, sitting in the same nest of groups they came from.

Flattening takes those four hundred shapes and merges them into one path element. The transforms get baked into the coordinates, every subpath is concatenated, and one color becomes one object you can select with a single click.

Separated only <g><circle/><circle/><circle/><circle/><circle/></g> 5 selectable objects, still nested in their groups Separated and flattened <path d="M…"/> 1 selectable object, transforms baked into the coordinates
Left, the shapes are merely filtered by color. Right, they are unified into one path. Same rendering, very different file to work with.

One thing to know. Flattening changes paint order in the combined exports, because interleaved colors now paint as whole groups instead of alternating. Individual layer files are unaffected. If your artwork depends on a red shape sitting between two blue ones, turn flattening off and keep the original structure.

The five step walkthrough

  1. Drop the file on the page. Or paste the raw markup. Nothing is uploaded anywhere, the parsing happens in your browser.
  2. Read the layer list. Every color found in the artwork appears with a swatch, a hex value and a shape count. Click the eye to hide a color, click the row to isolate it.
  3. Merge the near duplicates. Drag the tolerance slider until colors that differ only by a rounding error collapse together.
  4. Choose your output shape. Leave flattening on for one path per color. Decide whether strokes get their own layer or stay with their fill.
  5. Download. One layer at a time, all layers as a zip, a single layered file with one group per color, or a fully flattened file.
SVG Color Layers Flatten matched colors, export one layer per color Open SVG brand-mark.svg 412 shapes, 5 colors, 1.2 MB MERGE SIMILAR COLORS Flatten each color into one path Optimize output size LAYERS 5 #e8503a 148 #1f3a93 96 #f2b705 72 #2aa06b 54 #17171a 42 Download all layers (.zip)
The layer panel lists every color the parser resolved, including colors that came from a stylesheet rule rather than a fill attribute.

Merging colors that only look identical

Open a traced or exported illustration and you will often find that what your eye reads as one red is actually #ff0044, #ff0043 and rgb(255, 0, 68). Different strings, same ink. Left alone, that is three layers and three screens for one color.

The tolerance slider fixes this, but it does not compare hex codes. It converts every color into OKLab, a perceptual color space where the distance between two values matches how different they actually look to a human eye. A tolerance of 2 catches export rounding. A tolerance of around 10 starts grouping shades that a printer would treat as one ink anyway.

Tolerance 0 #ff0044 #ff0043 #fe0146 #fd0242 4 layers, 4 screens, 4 sheets of vinyl tol 4 Merged #ff0044 1 layer, and the tool tells you what it folded together
Distance is measured in OKLab, not in hex, so the grouping follows what the eye sees rather than what the numbers happen to be.

Making the output smaller without losing anything

Files that come out of a tracing tool or a design app carry a lot of freight that has nothing to do with what you see. The optimizer strips it, and it is careful to only remove things that cannot change a single pixel:

On a 30MB test illustration the combination of flattening and optimizing brought the output to 20.4MB, about a third smaller, with the geometry untouched. There is also a precision control if you want to trade decimal places for bytes, which is the one setting here that can technically alter geometry, so it defaults to a safe value derived from the viewBox.

SettingWhat it changesSafe to leave on
Merge similar colorsHow many layers you getYes, start at 0 and raise it
Split strokesOutlines become their own layerYes
Flatten each colorOne path per color, paint order in combined filesYes for cutting and printing
Optimize output sizeMarkup only, never geometryYes
PrecisionDecimal places in coordinatesAuto, unless you know your tolerance

Why huge files do not freeze the page

Most browser based SVG tools parse the file into a DOM and then ask the browser to compute a style for every element. That is fine for a 40KB icon. On a 30MB map export with 85,000 shapes it means minutes of waiting and hundreds of megabytes of memory, if the tab survives at all.

This tool never builds a DOM. The artwork stays as a single string. One streaming pass records the byte range of every element along with its resolved fill and stroke into flat typed arrays, resolving the cascade by hand instead of asking the browser. Every export is then produced by slicing the original string, so the cost of a layer is proportional to the shapes that layer keeps, not to the size of the file.

Measured on a synthetic 30MB file with roughly 85,000 shapes: parsing takes about 98 milliseconds in a 143MB heap, clustering the colors takes about 20 milliseconds, and producing all 25 layers plus the zip takes about three seconds. A file with 60,000 distinct colors still groups in about 200 milliseconds, because color clustering runs on a spatial hash rather than comparing every color to every other color.

What is deliberately left alone

A flattening tool that quietly changes your artwork is worse than no tool. Anything that cannot be merged without altering the result is copied through in its original form instead:

Because of that, the union of all exported layers always reproduces the file you started with.

Questions people actually ask

Is my file uploaded to a server?

No. The tool is a single HTML page and everything runs in your browser. The file never leaves your machine, which is also why it keeps working if you lose your connection after the page has loaded.

What is the difference between separating and flattening?

Separating puts every shape of one color into its own file but keeps them as individual elements. Flattening merges those shapes into a single path element, so one color becomes one object.

Can it handle very large SVG files?

Yes. A 30MB file with around 85,000 shapes parses in under a tenth of a second, because the artwork is never turned into a DOM.

Does it work for screen printing color separation?

For spot color artwork that is already flat vector, yes. Each ink becomes its own file at full size and position, which is exactly what a separation is. It does not do halftones, trapping, or process color separation from a photograph.

What happens to gradients and images?

Anything that is not a flat color is collected into a single leftovers layer and copied through untouched. Nothing is silently dropped.

Does the optimizer change how the file looks?

No. It removes comments, editor metadata, unused definitions and redundant whitespace, and rewrites path data in a shorter but numerically identical form.

Can I use the files in Cricut Design Space or Silhouette Studio?

Yes. Each exported layer is a plain SVG with the original viewBox, so all layers stay in register when imported. One file per color is the usual way to cut multi color vinyl.

Will it separate a JPG or PNG?

No. It works on vector artwork. Raster images need to be traced into vectors first, in Illustrator, Inkscape or an auto trace tool, and then they separate cleanly here.

Try it on your own file

No account, no upload, no install. Drop an SVG and you will see the layer list in under a second.

Open SVG Color Layers

Built and maintained by Medo Ismail, a product designer in Cairo.