Scalable Vector Graphics, the web standard maintained by the World Wide Web Consortium, opens with a definition short enough to fit on an index card: “SVG is a language for describing two-dimensional graphics” (W3C, SVG 2 Introduction). That sentence holds the whole split between vector and raster art. A vector file is a description, a set of instructions a program follows to draw the picture; a raster file is the finished picture itself, stored as a grid of coloured squares.

At a glance

  • Raster: images built from pixels, the tiny coloured squares that together make up photographs (Adobe)
  • Vector: images built from mathematical descriptions of lines, curves, shapes and colours (Adobe)
  • Raster formats: JPEG, PNG, GIF, BMP, TIFF, PSD (Adobe)
  • Vector formats: SVG, EPS, AI, PS, EMF, and PDF as a print-ready container (Adobe; Adobe)
  • Scaling: raster images lose quality when enlarged; vectors resize without loss (Adobe)
  • Print targets: Printful and Printify both aim at 300 DPI for raster print files (Printful; Printify)

Six letters that draw a shape

The path element

Inside an SVG file the basic drawing unit is the path, and the specification defines it plainly: “A path represents the outline of a shape which can be filled or stroked” (W3C, SVG 2 Paths). A path is written as a string of commands. M (moveto) lifts the pen and sets a starting point; L (lineto) draws a straight line; C draws a cubic BĂ©zier curve with two control points; Q draws a quadratic BĂ©zier with one; A draws part of an ellipse; Z closes the shape back to where it began (W3C, SVG 2 Paths).

What else an SVG can hold

SVG allows three kinds of graphic object: vector shapes such as paths of straight lines and curves, images, and text (W3C, SVG 2 Introduction). The abstract of the SVG 2 specification describes the language as XML-based and able to describe “two-dimensional vector and mixed vector/raster graphics” (W3C, SVG 2). A single file can therefore wrap a photograph inside a vector frame. SVG 2 is still a Candidate Recommendation, built on the SVG 1.1 edition released in 2003 (W3C, SVG 2; W3C, SVG 2 Introduction).

Why there are no pixels to lose

Adobe’s comparison is blunt: “There are no pixels in a vector file” (Adobe). The software redraws the geometry at whatever size the screen or printer asks for. On its page about vector files, Adobe says a vector logo “can’t ‘lose resolution,’ because it has no native resolution to begin with” (Adobe).

Macro view of a monitor where a color gradient breaks into square pixels and red, green and blue subpixels

A grid of coloured squares

How raster files store a picture

“Raster files are images built from pixels,” in Adobe’s words, and many pixels together can form a detailed photograph (Adobe). Because a photograph can contain millions of pixels, raster files run larger and are often compressed for storage and the web. Photoshop is raster-based; Illustrator is vector-based (Adobe).

The enlargement test

The quickest way to tell the two apart is to zoom. “If the image becomes blurred or pixelated, it’s most likely a raster file,” Adobe advises (Adobe). Raster resolution is measured in DPI or PPI, so the number of pixels a file holds fixes how large it can be printed before the squares begin to show.

Where raster wins

Vector art is a poor fit for photographs and detailed, continuous-tone images, which are usually better kept as raster files, Adobe notes (Adobe). Printful takes the same line from the production side: “We don’t recommend using SVG format files for photographs and raster images” (Printful).

A light pen in 1963

Sketchpad on the TX-2

In January 1963 Ivan Sutherland submitted a PhD dissertation at MIT titled Sketchpad: A Man-Machine Graphical Communication System (University of Cambridge Computer Laboratory). Its abstract begins: “A Sketchpad user sketches directly on a computer display with a ‘light pen'” (University of Cambridge Computer Laboratory).

Lines stored as data

Sketchpad stored drawn lines and circle arcs as data, let users define reusable symbols, and kept constraints such as two lines staying parallel while parts moved (University of Cambridge Computer Laboratory). The Computer History Museum, captioning a photograph of Sutherland at the TX-2 computer around 1963, says the program is “generally recognized as the first computer-aided drafting (CAD) program” and that changing a master template changed every instance of it (Computer History Museum). That is the logic of a modern vector symbol or component. The program also stored a drawing’s topology, so dragging one corner of a polygon carried the adjoining sides with it (University of Cambridge Computer Laboratory).

The 2003 reissue

Cambridge’s Computer Laboratory republished the thesis as a technical report in September 2003 with a new preface by Alan Blackwell and Kerry Rodden. They call Sketchpad “one of the most influential computer programs ever written by an individual” (University of Cambridge Computer Laboratory). Apart from legends, Sketchpad used no written language at all; functions such as erase or move were chosen with push buttons.

The same idea of a drawing as a list of moves reached artists through pen plotters, as in the work of Vera Molnar, and through code-based tools covered in the post on generative art with Processing and p5.js.

Print shop with a wide-format inkjet printer beside a vinyl cutting plotter and cut black vinyl shapes

Which one a print job wants

Raster print files

For print-on-demand products, Printful accepts JPEG, PNG and SVG and targets 300 DPI for JPEG and PNG, while products that need large files call for 120 to 150 DPI. Files that arrive below target are automatically enhanced before production, though the company still asks for high-resolution designs where they exist (Printful). Printify gives a matching rule of thumb: “Aim for 300 DPI (118 dots/cm), designed at the real print size,” adding that blankets and all-over-print garments often print well at 150 DPI (Printify). The phrase “at the real print size” matters. A 300 DPI file built for a postcard has too few pixels for a poster, and choosing proportions is a separate question covered in the post on aspect ratios and print sizes.

Vector print files

Printify invites uploads as “a vector SVG/PDF or a 300 DPI PNG” (Printify). For SVG work Printful recommends Adobe Illustrator or CorelDRAW (Printful). Adobe adds that saving vector art as PDF makes it easier to print (Adobe).

Embroidery and flat colour

One process in Printify’s guide states a hard requirement: “Embroidery requires vector artwork for conversion to .DST or .PES stitch files” (Printify). For dye sublimation and all-over prints the same guide suggests SVG for flat-colour designs, or a large PNG at full print-area size. Reproductions of paintings and photographs, such as giclĂ©e prints, fall on the photographic side of that line.

Mixing the two in one design

Logos and photographs together

Adobe suggests the two kinds often belong in one project, such as a brochure with a vector logo and raster photographs (Adobe). It lists business cards, T-shirts, posters, websites and billboards as places one vector logo might appear (Adobe). “Vector files are popular for images that need to appear in a wide variety of sizes,” the comparison page says (Adobe).

The costs of vector

Vector files usually stay small because they store instructions, and their shapes and colours can be edited repeatedly without loss. Against that, they need vector software, they are hard to edit in raster programs, and converting raster to vector is generally harder and more computer-intensive than the reverse (Adobe).

Turning pixels into paths

Image Trace in Illustrator

Illustrator’s Image Trace exists to “convert raster images into editable vector artwork,” according to Adobe’s help page (Adobe Help Center). Its Mode setting chooses Color, Grayscale or Black and White; in Black and White mode a Threshold slider decides which pixels turn black and which turn white. The Palette option ranges from Limited, a small set of colours, to Full Tone for photorealistic results (Adobe Help Center).

Paths, corners and noise

Three advanced sliders shape the result. Paths sets how tightly traced shapes follow the original pixels; Corners sets how readily sharp bends become corner points; Noise ignores areas below a pixel size, with Adobe suggesting roughly 20 to 50 for high-resolution images and 1 to 10 for low-resolution ones (Adobe Help Center). The Method choice decides whether shapes are cut out to meet exactly (Abutting) or stacked so they slightly overlap (Overlapping).

Expand, and the limits

A trace is not yet ordinary vector art until it is expanded. Expand “converts the result into editable vector paths for further refinement,” the help page says (Adobe Help Center). Adobe lists limits too: shape detection finds only isolated, perfect circles and squares, slightly rotated rectangles may trace less accurately, and gradients come through only with certain presets or settings (Adobe Help Center).

Frequently asked questions

Is a PNG a vector or raster file?

PNG is a raster format, listed by Adobe alongside JPEG, GIF, BMP, TIFF and PSD (Adobe).

Is PDF a vector format?

A PDF can carry vector artwork, and Adobe lists it among vector file types as a print-ready, shareable container (Adobe); the SVG specification itself also allows mixed vector and raster content in one file (W3C, SVG 2).

What resolution should a raster file be for printing?

Printful and Printify both aim at 300 DPI at the real print size, with 120 to 150 DPI acceptable for some large products (Printful; Printify).

Can a photograph be turned into a vector?

Illustrator’s Image Trace converts raster images into editable vector artwork, but Adobe says detailed images and photographs are usually better left as raster files (Adobe Help Center; Adobe).

Sources