PNG vs JPG vs WebP: Which Traces Cleanest?

We saved 12 logos as PNG, JPG and WebP at eight quality levels, traced all 96 files and scored them against the original vectors. Here are the numbers.

Measured in this post

WhatBeforeAfter
Mean error vs the original vector, PNG sourcecorpus/harness/blog/measure-live.mjs formats — 12 hand-authored reference logos rendered at 800 px, encoded eight ways, traced on the live site, scored against the original vector at 512 px.—0.15%
JPG at quality 80Same run; WebP at quality 80 scored the same from half the file size.0.15%0.19%
JPG at quality 40Same run; worse than the PNG for all 12 logos.0.15%0.33%
Median paths, PNG vs JPG quality 40Paths in the SVG the live site produced.4.57.5

If you have the same logo as a PNG, a JPG and a WebP, which one should you trace? The usual answer is "PNG, because it is lossless", which is true but not very useful. It does not tell you how much worse the others are, or whether a high-quality JPG is fine.

So we measured it: the same twelve logos saved eight different ways, every file traced through our live site, and every trace scored against the logo's original vector.

How we measured it

We started from twelve hand-authored vector logos, so the correct result is known exactly. Each was rendered to an 800-pixel image and saved as:

  • PNG, which is lossless.
  • WebP, lossless.
  • JPG at quality 95, 80, 60 and 40.
  • WebP, lossy, at quality 80 and 50.

That is 96 files. Each was uploaded to our live site and traced on default settings, then scored against the original vector: the average colour error per pixel, how many paths the trace used, and the size of the SVG it produced. The script and raw results are in our repository.

The results

SourceFile sizeMean errorPathsSVG size
PNG27 KB0.15%4.53.8 KB
WebP, lossless10 KB0.15%4.53.8 KB
JPG, quality 9537 KB0.19%4.53.9 KB
JPG, quality 8022 KB0.19%54.1 KB
WebP, quality 8011 KB0.19%53.9 KB
WebP, quality 508 KB0.23%5.54.0 KB
JPG, quality 6017 KB0.24%64.3 KB
JPG, quality 4014 KB0.33%7.57.3 KB

All figures are medians across the twelve logos.

What the numbers say

PNG and lossless WebP are identical. Same error, same paths, and the same SVG down to the byte, for all twelve logos. Lossless WebP just stores it in about a third of the space. If you have either, you have the best possible source.

Quality matters more than format. A JPG at quality 80 and a WebP at quality 80 traced the same, at 0.19% error. The WebP was half the file size. What changes the result is how hard the image was compressed, not which of the two formats compressed it.

High-quality JPGs are close, but not identical. Even at quality 95, the JPG traced measurably worse than the PNG. The error was 0.19% against 0.15%, and only 7 of the 12 logos came out within a hair of their PNG result. It traced worse than the PNG for 10 of the 12. The difference is small enough that you would rarely see it, but it points the same way almost every time.

Heavy compression costs you twice. At quality 40, the JPG was worse than the PNG for all twelve logos. The error more than doubled to 0.33%, the median trace needed 7.5 paths instead of 4.5, and the SVG was nearly twice the size.

Why compression turns into extra paths

JPEG and lossy WebP both throw information away in small square blocks. Inside a flat area of colour you rarely notice. Around a sharp edge, the compressor cannot represent the jump from one colour to another cleanly, so it leaves faint halos and blotches along the edge.

A tracer sees those halos as real colour. Unless something cleans them up first, each blotch becomes a tiny shape of its own, which is where the extra paths and the bigger file come from. Our tracer runs a cleanup pass on JPGs before tracing for exactly this reason. It keeps quality 80 close to the PNG, but it cannot recover detail that heavy compression already removed.

Which file to use

  1. Use PNG or lossless WebP if you have it. It is always the best source, and there is no advantage in converting it to anything else first.
  2. A JPG at quality 80 or higher is fine. Most photos and logos exported from design tools are in this range. The difference is real but small.
  3. Avoid re-saved and messaging-app copies. Every re-save and every trip through a chat app compresses a JPG again. The first file the designer sent is worth hunting down.
  4. Never convert a JPG to PNG to improve it. A PNG made from a JPG contains the same compression damage, stored losslessly in a bigger file. It will trace exactly like the JPG it came from.
  5. A WebP saved from a website is usually lossy. It traces like a JPG of similar quality. If the artwork is yours, the original export will do better.

The short version

For tracing, the order is: lossless (PNG or WebP) first, then high-quality lossy, then heavily compressed anything. The format name matters much less than whether the file was compressed hard along the way.

The twelve reference logos, every encoding setting, and the scoring are in the measurement script in our repository, so all of the figures above can be reproduced.

Common Questions

Is PNG or JPG better for converting to SVG?
PNG. It traced with the lowest error in our tests, identical to lossless WebP. A JPG at quality 80 or higher is close, but heavily compressed JPGs more than double the error and add extra paths.
Does converting a JPG to PNG improve the trace?
No. The PNG contains the same compression damage as the JPG it came from, just stored losslessly in a bigger file. It traces exactly like the original JPG.
Is WebP good for tracing?
Lossless WebP traced identically to PNG. Lossy WebP traced like a JPG of similar quality, from a smaller file. A WebP saved from a website is usually lossy.
Why does a compressed JPG make a bigger SVG?
Compression leaves faint halos and blotches around edges. A tracer reads them as real colour, and each one can become a small extra shape, which adds paths and file size.

Brenden F — Founder, VectorizerKit

Built the tracing engine the measurements in these posts come from, and the harness that grades it.