Design glossaryImage resolution is the amount of detail an image holds, given as its width and height in pixels, or as pixel density (PPI) when printed.
Image resolution describes how much detail an image can hold. For a digital image, that means its pixel dimensions: a photo 4,000 pixels wide and 3,000 pixels tall contains 12 million pixels, or 12 megapixels. For print, resolution also means pixel density, the number of pixels packed into each inch of paper, written as PPI. The two are linked: the same 4,000-pixel image prints about 13 inches wide at 300 PPI, or about 55 inches wide at 72 PPI with visibly coarser detail.
Screens versus print
On the web, only the pixel dimensions matter. The PPI value stored in a file's metadata, whether 72 or 300, has no effect on how a browser displays it; a 1,200-pixel image looks the same either way. The old advice to "save web images at 72 DPI" is harmless but meaningless.
In print, density matters a great deal. Around 300 PPI at the final printed size is the usual target for sharp photos in brochures and books, while large posters and signs viewed from a distance can get away with less. Printers often talk about DPI, which strictly describes the printer's ink dots rather than the image's pixels, but the two terms are used loosely.
High-density screens
Most phones and many laptops have high-density displays that use two or three physical pixels across, in each direction, for every CSS pixel. An image shown 600 CSS pixels wide therefore needs to be about 1,200 pixels wide to look crisp on those screens. The answer is not to send everyone the biggest file, but to offer several sizes with the srcset and sizes attributes and let the browser choose.
Image resolution in WordPress
WordPress handles much of this for you. On upload it creates several copies at different widths, its image sizes, and adds them to a srcset automatically when the image is inserted into a post. Very large uploads (wider or taller than 2,560 pixels by default) are scaled down to that size for use on the site, with the original kept on the server.
A few rules we follow when preparing images for a WordPress site:
- Size for the largest slot. A full-width hero rarely needs more than about 2,000 to 2,500 pixels across; a blog image in a content column needs far less.
- Do not upscale. Enlarging a small image adds pixels but not detail, so it just looks soft. Start from a larger original, or use a vector image for logos and icons.
- Compress after resizing. Resolution sets the pixel count; compression and format (JPEG, PNG, WebP, or AVIF) set the file size.
- Watch your largest image. An oversized hero is one of the most common causes of a slow Largest Contentful Paint.
Source: MDN, Responsive images.