01

Two ways to store a picture

Every digital image is stored in one of two basic ways. A raster image, also called a bitmap, divides the picture into a grid of tiny squares called pixels and records the colour of each one. Photographs from phones and cameras are rasters, as are scanned documents and most images on websites. A vector image records instructions instead: draw a circle here, a curved line there, fill this shape with red. Logos, icons, maps, technical drawings and typefaces are usually vectors. Both end up on screens made of pixels, but they reach those pixels by very different routes, and that difference decides how each behaves when it is resized or edited.

02

How raster images work

A raster's quality depends on how many pixels it contains. A 12-megapixel phone photo, for example, is a grid of about 4,000 by 3,000 pixels, or 12 million. Each pixel typically stores red, green and blue values, so uncompressed the image would need about 36 megabytes. Formats such as JPEG, PNG, WebP and HEIC compress that data. Rasters are ideal for photographs and paintings, where colour changes subtly from point to point and there are no clean shapes to describe. The limitation is that the grid is fixed. Enlarging the image does not add detail; software must invent in-between pixels, so edges become soft, blurred or blocky.

03

How vector images work

A vector file describes a picture as geometry. Lines and curves are defined by points and mathematical formulas, usually Bézier curves, which use control points to describe smooth bends. Shapes can be filled with colours or gradients. Common vector formats include SVG, used widely on the web, as well as PDF, EPS and the native files of design programs. When the image is displayed, the software calculates which pixels each shape covers at the current size, a process called rendering or rasterising. Because this happens fresh each time, a vector logo can be shown on a phone icon or printed across a building with perfectly crisp edges, and the file stays small.

04

The scaling test

Consider a company logo needed for a business card, a website and a billboard on Sheikh Zayed Road. As a vector, one file serves all three, since it is redrawn sharply at each size. As a raster sized for a website, it would look jagged when blown up to several metres wide. Printing reveals the same limits for photos. Print shops often aim for about 300 pixels per inch for sharp prints viewed up close, so a 4,000 by 3,000 photo prints sharply at about 34 by 25 centimetres. Billboards, viewed from far away, can use far fewer pixels per inch. This is why designers keep logos and type as vectors until the last possible moment.

05

Converting between them

Turning a vector into a raster is easy and exact: the software simply renders it at the chosen size. Going the other way is hard. Tracing tools can detect edges in a raster and approximate them with vector shapes, which works well for simple, bold artwork such as a hand-drawn logo, but a photograph traced into vectors becomes a mass of flat patches and loses its realism. Many real-world files mix both. A PDF brochure may contain vector text and graphics alongside raster photographs. The fonts on this page are vectors too: each letter is stored as an outline and rendered into pixels for your screen, which is why text stays sharp when you zoom.

06

Choosing the right one

The rule of thumb is simple. Use raster formats for photographs, scans and images with complex textures or lighting. Use vector formats for logos, icons, diagrams, charts, maps and anything that must appear at many sizes or be edited later. On websites, SVG icons stay sharp on high-resolution displays and load quickly, while photos are best as compressed rasters. A common mistake is saving a logo only as a small JPEG, which forces later redesigns to recreate it. Another is enlarging a small photo and expecting more detail. Artificial intelligence upscaling can guess convincing detail, but it is inventing pixels, not recovering information the camera never captured.

FOLLOW THE EVIDENCE

Sources & further reading

Figures are rounded and widely published; check the linked organisations for the latest editions. These organisations do not endorse this website.