Sub topic 9
Imagery, Resolution and File Formats
This chapter assumes you know the difference between vector and raster graphics, and that you have read the placement specification for your ad. Here you choose images that stay sharp and files that meet the placement's rules.
Resolution means different things in print and on screen
A raster image is a grid of pixels. Its sharpness depends on how many pixels cover each unit of physical space.
- Print uses pixels per inch (ppi). The usual target is 300 ppi at final size. Large posters viewed from a distance often accept 150 ppi or less.
- Screens use pixel dimensions. The ad slot is a fixed number of pixels, and ppi does not matter.
Pixel dimensions equal physical size in inches times ppi. The physical size must include the bleed (the extra image area beyond the trim edge) on both sides.
// Pixel size needed for a print image at a given resolution.
const pixels = (inches, ppi) => Math.round(inches * ppi);
// A 5 x 7 inch ad with 0.125 inch bleed on every side, at 300 ppi.
const bleed = 0.125;
const width = pixels(5 + 2 * bleed, 300);
const height = pixels(7 + 2 * bleed, 300);
console.log(width, height); // 1575 2175The bleed adds 75 pixels per side at 300 ppi. If you forget it, the photo falls short of the page edge.
Retina and high-density screens
Phones and many laptops pack two or more physical pixels into each CSS pixel. A 300 x 250 banner shown with a 300 x 250 image looks blurry on these screens. Supply a 2x image (600 x 500) and let the browser pick the right one with srcset.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="ad.size" content="width=300,height=250">
<title>Spring Sale 300x250</title>
</head>
<body style="margin:0">
<a href="https://example.com" style="display:block;width:300px;height:250px">
<img src="banner.png" srcset="banner.png 1x, [email protected] 2x" width="300" height="250" alt="Spring Sale: 20% off">
</a>
</body>
</html>The ad.size meta tag is the one Google Ads HTML5 uploads read. The alt text describes the ad for screen readers.
Choosing a file format
| Format | Type | Best for | Watch out for |
|---|---|---|---|
| TIFF | Raster, lossless | Print photos | Large files |
| PSD | Raster, layered | Editable masters | Not accepted by most placements |
| JPEG | Raster, lossy | Photos online | Artefacts after repeated saves |
| PNG | Raster, lossless | Flat graphics, transparency | Heavy for photos |
| WebP | Raster | Small web files | Not accepted everywhere |
| SVG | Vector | Logos, icons online | Fonts and effects may not render |
| PDF or EPS | Vector and raster | Logos and artwork for print | Keep fonts embedded or outlined |
Use vector files for logos and shapes. They scale to any size with no loss. Use raster files for photographs.
Common errors
- Images pulled from a website. They are usually 72 to 96 ppi and too small for print.
- Wrong colour mode. Photos in RGB may shift when converted to CMYK for print. Convert and check early.
- Over-compression. Heavy JPEG compression to meet a file-weight limit leaves blocky edges around text and logos.
- Linked images that go missing. Embed or package linked files when you hand off a layout.
- Cropping after placing. Scaling a placed image up lowers its effective ppi. Check the effective ppi in your layout tool's links panel.
Exercise
A poster is 12 x 18 inches with 0.25 inch bleed on every side. It will be printed at 150 ppi. What pixel dimensions does the background image need?
Show answer
Add the bleed to both sides: 12 + 0.5 = 12.5 inches wide and 18 + 0.5 = 18.5 inches tall. At 150 ppi that is 12.5 x 150 = 1875 pixels wide and 18.5 x 150 = 2775 pixels tall.
Exercise
You must place a 300 x 250 pixel banner image on a phone with a 2x screen. Which file size should you supply for sharp display, and how does the HTML pick it?
Show answer
Supply a 600 x 500 pixel file as the 2x image. Add it to the srcset attribute (for example "[email protected] 2x") and keep the width and height attributes at 300 and 250.