Formats8 min · 24 Jul 2026

Raster vs vector: why an SVG is drawing instructions, not pixels

A PNG is a grid of pixels and an SVG is a list of shapes to draw. That one difference decides how each one scales, how big the file gets, and which conversions work.

The Whatafile team

· Updated

An SVG is a vector image: instead of storing pixels, the file stores drawing instructions, such as draw a circle here and fill this path blue. That is why it stays sharp at any size. PNG and JPG are raster images, a fixed grid of pixels that goes soft and blocky when you enlarge it.

That is raster vs vector in one sentence, and it decides almost everything else: which format suits a logo and which suits a photo, why one file is tiny and another huge, and why turning an SVG into a PNG is easy while turning a PNG into an SVG is not.

What is an SVG file?

So what is SVG, exactly? The name stands for Scalable Vector Graphics. The W3C SVG 1.1 specification describes it as a language for describing two-dimensional graphics in XML, gives its media type as image/svg+xml and recommends the .svg extension. SVG is an image format like PNG, then, but the SVG file format is plain text: open one in a text editor and you can read every instruction.

For this post we wrote a small SVG by hand, a blue badge with a white tick, 264 bytes in all. Its instructions come down to three:

  • Make a canvas 200 units wide and 200 units high.
  • Draw a circle in the middle with a radius of 90 units, and fill it blue.
  • Draw a white line through three points, 18 units thick with rounded ends: the tick.

The file stores no pixels at all, and the 200 is only a size to show it at. Whatever draws the badge, a screen or a printer, works out the pixels at the size it is shown, which is the scalable in the name.

Raster vs vector: what is the difference?

A raster image is a grid of measured colours, one per pixel. PNG, JPG, WebP, GIF and TIFF all work this way: the W3C PNG specification describes PNG as a format for storing raster images. A vector image is a list of shapes and paths. The first is a recording; the second is a score. A recording is fixed at the quality it was made at; a score can be played again at any size.

Vector vs raster images side by side
Raster (PNG, JPG, WebP)Vector (SVG)
Made ofA grid of pixels, one colour eachShapes, lines, curves and text, written as instructions
When you enlarge itGoes soft or blocky, because the pixels are stretchedStays sharp, because the shapes are drawn again at the new size
Best forPhotographs, screenshots and anything with fine textureLogos, icons, diagrams and line drawings
How you edit itIn a photo editor, pixel by pixelIn a vector program, shape by shape: move, resize or recolour
What makes the file biggerMore pixelsMore shapes, and more detail in each one

So the vector vs raster image question is about what the picture is made of. A photograph is millions of slightly different colours, which pixels suit; a logo is a few clean shapes, which instructions suit.

In October 2026 we drew our badge as a PNG at two sizes on our own SVG to PNG page, changing only the width and height written in the SVG:

Our badge as an SVG and as a PNG, October 2026
Drawn atSVGPNG
200 × 200 pixels264 bytes5.9 KB
2,000 × 2,000 pixels266 bytes143 KB

Ten times wider made the PNG about 24 times bigger. The SVG grew by two bytes, because 200 became 2000 twice.

SVG vs PNG: which should you use?

Use SVG for logos, icons and line drawings that must stay sharp at any size, and PNG for screenshots and anywhere that accepts only pixel images. The SVG vs PNG choice follows the picture:

  • A logo or an icon: SVG. It stays sharp from a browser tab to a poster, and you can recolour it.
  • A diagram or line drawing: SVG if it was drawn as shapes, PNG if all you have is a picture of it.
  • A screenshot: PNG, which keeps every pixel exactly.
  • A photograph: JPG, or WebP for a website. Shapes cannot describe a photo well, and a photo saved as PNG is large.
  • A form or program that asks for PNG or JPG: a PNG made from your SVG.

PNG vs SVG on file size depends on the picture too. For flat shapes the SVG wins easily, as the badge shows; for a photograph it is the other way round, as the tracing test below shows.

SVG vs JPG is the simplest call of all: JPG is for photographs and SVG is for drawings. When the choice is between the two pixel formats, JPG vs PNG explains when to send which.

Can you convert a PNG to SVG?

Yes, but only tracing gives you a real vector, and tracing suits only some pictures. There are two ways to turn a PNG into an .svg file:

  • Wrapping: the PNG goes inside an SVG file unchanged, which the SVG specification allows, since an SVG may hold pictures as well as shapes. It ends in .svg, but it is still pixels and still blurs when enlarged.
  • Tracing: areas of colour become shapes with smooth outlines, a true vector that stays sharp at any size and can be edited shape by shape.

Our Image to SVG converter traces. You pick a style (Logo or icon, Illustration, or Black and white), from 2 to 64 colours and the level of detail, and see a preview of the trace beside your picture. It runs in your browser, so nothing is uploaded, and our PNG to SVG address leads straight to it.

Words saved in a plain-text file need no tracing: when you convert text to SVG, our server draws every letter as a vector outline, so the words stay sharp at any size.

What tracing did to a logo and to a photo

We traced two pictures in October 2026. First our badge, as a 2,000-pixel PNG of 143 KB. With Colours set to 3, it came back as a 5.3 KB SVG holding the blue circle and white tick as real shapes, in almost exactly the original blue. That is bigger than the 266-byte original, because the circle returns as an outline of many short lines and curves, not one circle instruction.

Then a photograph: a NASA picture of dune restoration at Kennedy Space Center, reduced to 2,000 × 1,333 pixels, an 895 KB JPG. With the default 8 colours, the trace held 26,395 shapes and came to 8 MB, about nine times the JPG. The tool warns of exactly this: photos turn into thousands of shapes and big files.

Worth knowing

Tracing works well on a two-colour logo and produces expensive nonsense on a photograph of a face. Start from the biggest, cleanest copy of a logo, with the colours set to the number it really uses.

SVG to PNG, JPG or PDF: the easy direction

Going the other way is easy: an SVG carries no resolution of its own, so it can be drawn at any size with no loss. Our SVG to PNG converter draws the PNG in your browser at the width and height written in the SVG (or its viewBox), up to 8,192 pixels on the longest side. For a bigger PNG, pick 2×, 4× or a width in pixels under Size; raising those two numbers in the SVG, as we did for the badge, works too. See-through areas stay see-through.

A GIF suits a site or app that takes GIF but not SVG: when you convert SVG to GIF, you get one still picture of up to 256 colours, and soft see-through edges turn hard.

If the picture must be a JPG, convert SVG to JPG: a JPG cannot store transparency, so the see-through areas turn white. If you need the drawing on a page, convert SVG to PDF, which places it on an A4, US Letter or fitted page. Either way the result is pixels, so keep the SVG as your master copy.

HTML is a different case. A web page can show an SVG as it is, through an image element or with its code pasted into the page, so there is nothing to convert. When you convert SVG to HTML, our server reads the English words in the drawing and gives them to you as a plain web page, without the drawing itself.

A sharp logo or a smaller file: what you actually need

People who ask to turn a PNG into an SVG usually want one of two things:

  • A logo that stays sharp when enlarged. Ask whoever designed it for the original vector file first; tracing the PNG is the fallback, and works best on a simple logo with few colours.
  • A smaller file for a website. That needs WebP, not SVG: PNG to WebP converts in your browser and keeps any transparency, and Google's WebP documentation puts even lossless WebP at 26% smaller than PNG.

Neither is solved by converting a photo or a screenshot to SVG, and we would rather tell you here than after the conversion.

SVG questions

What is an SVG file?

An SVG file is a vector image: a text file, written in XML, that lists shapes to draw instead of storing pixels. It ends in .svg, and because it is drawn fresh at whatever size it is shown, it stays sharp at any size.

What is a vector image?

An image made of shapes, lines and curves described as instructions, not a grid of pixels. It stays sharp at any size, and a vector program can move, resize or recolour each shape.

Is SVG better than PNG?

For logos, icons and line drawings, yes: an SVG stays sharp at any size and is often far smaller. Screenshots and photos are pixels to begin with, so they belong in a PNG, or a JPG for a photo.

Can you convert a PNG to SVG?

Yes, by tracing, which turns areas of colour into shapes. It suits logos, icons and flat drawings, not photos: our test photo became over 26,000 shapes and an 8 MB file. Merely wrapping a PNG in an SVG gives a file that still blurs when enlarged.

When should you use SVG?

Whenever a picture is made of clean shapes that must stay sharp at any size or be recoloured later: logos, icons, diagrams and line art. Where only PNG or JPG is accepted, send a PNG made from it.

Our cookies keep you signed in. If you accept, we also load Google Tag Manager, which runs Google Analytics and Microsoft Clarity (which records how you move around the site). None of them run unless you accept. The privacy page has the details.

Read first