Skip to content

Keeping text readable over photos and banners

Text on a picture still has to meet the contrast rules. Here's how to measure it, and the ways to make a banner pass without losing the photo.

Checked 24 November 2026

Text on a picture still has to meet the contrast rules. The picture doesn't change that. It only makes the measuring harder, because the background isn't one colour any more.

What the rules say

Text over gradients, semi-transparent colours and background images still needs to meet the contrast requirements. WebAIM adds that WCAG gives no guidance on how to measure them, so its advice is to usually test the area where contrast is lowest.1 That's the sensible habit: find the lightest patch behind dark text, or the darkest behind light text, and measure there.

The target is the usual one. Text and its background should have a ratio of at least 4.5 to 1.2 Larger text, at least 18 point or 14 point bold, has a lower minimum.2 The size cut-offs sit elsewhere on this site.

Photos change from place to place

A photo has bright and dark patches, and one headline can cross both. White text may sit well on a dark hillside and vanish against a cloud. Check the worst spot, not the average one. If the picture is cropped differently on a phone, the words may land on a different part of it, so look at that layout too.

Ways to make the text pass

Each of these gives the text a steadier background.

A darker layer behind the words. Put a solid or semi-transparent panel between the photo and the text. Be careful with transparency, though. Reducing the alpha reduces contrast because the picture shows through.1 A mostly solid panel is more reliable than a faint one. Measure the text against what you actually see on screen.

A solid block for the text. Place the headline in its own box beside, or at the edge of, the picture. The background is then one known colour, and the check is simple.

An outline or glow. WebAIM says the colour of a text outline or border can be used as the text colour when measuring contrast, and a text glow or halo can be used as the background colour.1 A dark halo behind white text can help it stand out against a busy photo. Measure the halo colour against the text, and make sure the halo is wide enough to be there at every letter.

A different picture. Sometimes the simplest fix is a photo with a quiet area, such as sky, water or a plain wall, where the text can sit.

Making banner text passFind the busiest part behind the textAdd a solid or darker layer behind itMeasure text against that layerCheck the narrowest screen tooFix the weakest spot and recheck
Put something steady behind the words, then measure that.

Don't put text inside the image file

It's tempting to bake a headline into a banner graphic. Don't. The contrast rules apply to text within a graphic as well, and it's hard to check.1 Real text also scales better. WebAIM notes that low quality graphics containing text may become blocky and pixelated when enlarged. It recommends using true text as much as possible, rather than rasterised or graphical text.3

Which text on a picture is exempt

Not every word on a photo needs to pass. A logo or brand name has no contrast requirement.1 Text that's part of a picture containing significant other visual content is treated as incidental too, such as small lettering in the background of a photo.1

WebAIM offers a rule of thumb for deciding. Text that would be part of the image's alternative text should probably meet the requirements. Text that wouldn't be added to the alternative text can usually be considered incidental.1 A headline that says what the banner is about belongs in the first group.

A short routine

Pick the weakest spot behind the text and measure it. Fix it with a panel, a block or a different crop. Then measure again on a phone-width layout. For the tools themselves, open the checking guide.

Cited material

  1. Contrast and Color Accessibility, WebAIM, Utah State University
  2. Color contrast, MDN Web Docs, Mozilla
  3. Visual Disabilities - Low Vision, WebAIM, Utah State University