Raster vs vector: the difference, and which one you need

A raster image is a grid of pixels; a vector image is a set of shapes. What that means for sharpness, file size, editing, printing, cutting and engraving.

Published

A raster image is a grid of coloured squares, called pixels. A vector image is a list of shapes: lines, curves and fills described by coordinates. A photo is raster. A logo, a font and a cut file are vector.

The practical difference is what happens when you enlarge them. A raster image has a fixed number of pixels, so blowing it up only makes the pixels bigger, and the picture turns soft and blocky. A vector image is redrawn from its description at whatever size is asked for, so it is exactly as sharp on a billboard as on a business card.

“Bitmap” is another word for raster. Strictly a bitmap has one bit per pixel, black or white, but in everyday use the two words mean the same thing: a picture made of pixels.

Side by side

Raster (bitmap)Vector
Made ofPixels in a gridPaths: lines and curves
EnlargingBlurs and shows pixelsStays sharp at any size
Best forPhotos, paintings, texturesLogos, type, icons, diagrams, cut files
File size grows withPixel dimensionsNumber and complexity of shapes
Edited byChanging pixelsMoving points and changing shapes
Common formatsJPG, PNG, GIF, WebP, TIFF, BMP, HEICSVG, AI, EPS, DXF; PDF can hold both
Made byCameras, scanners, screenshots, paint programsDrawing programs, CAD, code

Why photos are raster

A photograph has a different colour at almost every point, with no clean edges to describe. Recording it as a grid of samples is the natural fit, and it is what a camera sensor does. Turning a photo into shapes would need millions of them and would still look wrong.

Raster images have a resolution: so many pixels wide and high. How large one prints depends on how many of those pixels go in each inch; the DPI calculator works that out.

Why logos and cut files are vector

A logo is a handful of shapes with flat colour and hard edges. Describing those shapes takes very little data, the edges are mathematically exact, and the same file serves every size.

Machines that follow a path need vectors for a different reason. A vinyl cutter, a pen plotter and a laser cutting an outline all have to be told where to move. A vector path is that instruction. A grid of pixels has no path in it: the edge of a shape is only implied by where the colours change.

Which one machines want

  • Printers accept both. Everything is turned into dots at the last moment, at the printer’s own resolution, so vector artwork prints as sharply as the printer can manage.
  • Cricut, Silhouette and other cutters cut along vector paths. Give them an SVG or a DXF. They can also trace a simple raster picture, with rougher results.
  • Laser cutters use both in one job: vector paths to cut and score, and raster images to engrave, scanning back and forth like a printer.
  • Pen plotters draw vector paths only. To plot a photo it has to become lines first, which is what the Plotcaster editor does.
  • Screens show pixels, so vectors are rasterised on the fly, at the exact size needed.

Converting between them

Vector to raster is called rasterising. It is easy and exact: choose a size in pixels and the shapes are drawn into that grid. The only decision is how many pixels, because you cannot get them back later. SVG to PNG does this.

Raster to vector is called tracing or vectorising. It is an interpretation. Software has to decide where the edges are and fit curves to them, which works well for artwork with flat colours and clear edges and poorly for photos. PNG to SVG and JPG to SVG trace a picture into paths.

Be wary of one shortcut. Saving a photo “as SVG” or “as PDF” in some programs just wraps the pixels in a vector file. The extension changes; the picture is still raster and still blurs when enlarged.

How to tell which you have

Zoom in a long way. If the edges go soft or break into squares, it is raster. If they stay crisp however far you go, it is vector. The file extension is a strong hint but not proof, because SVG, PDF, EPS and AI files can all contain embedded raster images. The SVG viewer counts the paths and images inside an SVG.

Questions

Is PNG raster or vector? Raster. So are JPG, GIF, WebP and TIFF.

Is SVG raster or vector? Vector, although an SVG can embed a raster image inside it.

Is PDF raster or vector? Either or both. A PDF exported from a drawing program holds vectors; a scanned PDF holds a raster picture of each page.

Which is better quality? Neither as such. Vector is better for anything made of shapes, because it never loses sharpness. Raster is the only sensible form for photographs.