Design glossaryA vector image is made of mathematically defined paths rather than pixels, so it stays sharp at any size. SVG is the vector format of the web.
A vector image stores a picture as instructions rather than dots: points, lines, curves, and shapes, each with a position, a fill, and a stroke. To draw it, the software calculates those shapes at whatever size is needed, so a vector logo is as crisp on a business card as on a billboard. A raster image, such as a JPEG or PNG photo, stores a fixed grid of pixels instead, and blurs or turns blocky when enlarged beyond its resolution.
Vector versus raster
| Vector | Raster | |
|---|---|---|
| Made of | Paths and shapes | A grid of pixels |
| Scaling | Sharp at any size | Loses quality when enlarged |
| Best for | Logos, icons, illustrations, charts, and type | Photos and complex, textured images |
| Common formats | SVG, AI, EPS, and PDF | JPEG, PNG, WebP, AVIF, and GIF |
Vectors are not always smaller. A simple icon may be a few hundred bytes as SVG, but a detailed illustration with thousands of points can outweigh a well-compressed raster version. Photos cannot sensibly be vectors at all. Fonts, incidentally, are vectors too, which is why text stays sharp at any size.
SVG: the vector format of the web
SVG (Scalable Vector Graphics) is an open W3C standard written in XML, and every modern browser displays it. It can be used in two main ways:
- As an image (
<img src="logo.svg">): simple and cacheable, but the page's CSS cannot restyle it. - Inline in the HTML: its shapes can be styled and animated with CSS. Setting
fill="currentColor"lets an icon take on the color of the text around it, which suits icon sets and hover states.
SVGs exported from design apps often carry editor metadata and redundant points. Running them through an optimizer such as SVGO usually makes them much smaller without visible change. Give meaningful SVGs a text alternative, such as alt text on the image or a <title> inside inline SVG.
Vector images in WordPress
WordPress does not allow SVG uploads to the Media Library by default. Because SVG is code, a malicious file can contain scripts, so an unchecked upload is a security risk. Sites that need SVG uploads should use a plugin that sanitizes each file, and limit uploads to trusted users. Themes can also include SVG icons and logos directly in their templates, which avoids the upload question altogether.
Working with vectors
Vector artwork is made in apps such as Adobe Illustrator, Affinity Designer, Inkscape, and Figma. Keep the editable source file for logos and brand graphics: a vector original can be exported to any size or format later, while a small PNG can never be turned back into a sharp, scalable logo.
Source: MDN, SVG.