keep brand colors when vectorizing a logo
How to Keep Brand Colours When Vectorizing a Logo
TL;DR. A tracer averages the pixels in each colour region, so anti-aliased edges and JPEG noise pull fills a few values off your brand hex. Get the official codes from the brand guide, trace with a low colour count, then replace each fill with the exact hex. Keep Pantone and CMYK values in the print file, not the SVG.
Convert your file now →You trace a logo and it looks right, until someone holds it next to the brand guide and the blue is a shade too grey. A tracer can only copy colour from your pixels, and those pixels were rarely the exact brand values. To get them back, fix the colours before and after the trace, not during it.
Why do the colours change when you vectorize a logo?
A tracer groups similar pixels into regions and gives each region one flat fill: the average of the pixels it took in. Three things pull that average away from the true brand colour.
| Cause | What happens | How far off |
|---|---|---|
| Anti-aliased edges | Edge pixels blend logo colour with background, and some get grouped into the fill | A few values per channel |
| JPEG compression | Lossy blocks add tinted noise inside flat areas | Visible on reds and dark blues |
| An off-brand source | The PNG was exported, screenshotted or recompressed from a copy of a copy | Anything. The source is already wrong |
The first two are small and predictable. The third is why you shouldn't pick colours from the image you're tracing.
How do you keep the exact brand colours?
- Get the official values first. Find the hex codes in the brand guide, the designer's handover files or your website's CSS. Write them down before you open the image. If nothing exists, eyedrop the centre of the largest flat area in the best-quality copy you have.
- Trace with as few colours as the logo really has. A three-colour logo should come out as three fills, not twelve near-identical tints. Our logo to SVG converter has a Colors slider (lower merges similar shades) and a free watermarked preview; the clean SVG costs one credit. For a fixed palette, reduce the image to exactly those colours in an image editor before you trace.
- Snap every fill to the brand hex. Each traced region is now one flat colour, so replacing it is a quick swap. Do it in whichever tool you have (see below).
- Merge leftover near-duplicates. If two fills both map to the same brand colour, give them the same hex and union the shapes. Cleaning up a traced SVG covers merging and deleting stray specks.
- Check the result against the palette. Open the SVG in a text editor and
list every
fill=value. Anything that isn't on your list is either noise to delete or a colour you missed.
How do you replace the colours in each tool?
Illustrator
If you trace inside Illustrator, you can skip the snapping step. Adobe's Image Trace panel options describe a Document Library palette, available when Mode is set to Color, which "uses an existing color group, allowing you to define the exact colors you want in the result." Make a swatch group of your brand colours first, including white if the logo uses it, then pick that group in the trace settings. For a file traced elsewhere, select each colour and type the hex into the Color panel.
Inkscape
Click a shape, then use Edit > Select Same > Fill Color to grab every shape
in that colour. Open Fill and Stroke (Shift+Ctrl+F) and type the brand value
into the RGBA field. The
Inkscape manual
explains that this field is the colour "in hexadecimal code, as it is used in a
web page's CSS", with two extra characters for opacity, so enter 0057b8ff
for a fully opaque #0057b8.
A text editor
An SVG is plain text, and traced shapes store their colour as a fill="#…"
attribute. Find-and-replace #0158b6 with #0057b8 and every shape in that
colour changes at once. MDN's hex colour reference
notes the syntax is case-insensitive, so search for both #0158B6 and
#0158b6, or use a case-insensitive search.
What about Pantone and CMYK?
Keep them out of the SVG. MDN defines a hex colour as an sRGB colour, so an SVG fill can only hold the screen version of a brand colour. A Pantone reference has no exact hex equivalent, and even Pantone's own tools can list slightly different values for the same swatch.
Use the SVG as your master shape file with the brand's screen hex values. When a printer needs spot or CMYK colours, open the SVG in Illustrator, Inkscape or Affinity, assign the Pantone or CMYK values there, and export a PDF. SVG vs PDF for print explains why the PDF is the file to send. For spot-colour jobs such as t-shirts, SVG for screen printing covers separating each ink onto its own shape.
How do you stop the colours drifting again?
Save the corrected SVG as the one master, and export every PNG, favicon and social image from it rather than from older rasters. Put the hex values in a short colour list next to the file. The next person who needs the logo can then check a fill in seconds instead of eyedropping a JPEG from an old slide deck.
Frequently asked questions
- Why is my traced logo a slightly different colour?
- Every pixel along a soft edge is a blend of the logo colour and the background, and JPEG compression adds more off-shades. A tracer gives each region the average of the pixels it groups together, so a red of #D52B1E can come back as #D42C20. It looks identical on screen, but brand checks and print matching will catch it.
- Can I put a Pantone colour in an SVG?
- Not as a Pantone colour. SVG fills are sRGB values such as #0057B8, so you can only store a screen approximation. Pantone's own tools can give slightly different hex values for the same swatch. Keep the Pantone reference in your brand guide and in the PDF or AI file you send the printer.
- Should I use an eyedropper to get my brand colours?
- Only as a last resort. An eyedropper reads whatever pixel you click, and in a compressed or resized logo that pixel may already be off-brand. Use the hex codes from the brand guide or the designer's handover. If none exist, sample the middle of a large flat area, never an edge.
- How do I check which colours an SVG uses?
- Open it in a text editor and search for fill=. Each traced shape carries its colour as a hex code, so you can list them all and compare them with your palette. In Inkscape, select a shape and read the RGBA field in Fill and Stroke; Edit > Select Same > Fill Color then shows every shape sharing it.
Ready to convert?
Drop your file, preview the trace free, and download a clean SVG.
Open the converter →