New Tool Radar

Design Accessibility

How to Check Text Over an Image in an AI Design

Check that text placed over a photograph in an AI design still meets the 4.5:1 contrast ratio.

Schematic diagram: steps to check wcag 1.4.3 contrast (minimum) on an AI-designed page — with a practice result of 4 of 6 checks passing and 2 failing for the fictional Maple Corner hero banner.

An AI design tool can lay out a page that looks finished and still fail the accessibility rule it was supposed to follow. WCAG 1.4.3 Contrast (Minimum) is the rule this guide checks: the visual presentation of text has a contrast ratio of at least 4.5:1, and the rule also applies to text shown over images. A design that passes by eye can still fail it, so check the rule itself, not the look of the page.

What the rule asks

WCAG 1.4.3 Contrast (Minimum) asks that the visual presentation of text has a contrast ratio of at least 4.5:1, and the rule also applies to text shown over images. The rule is written for the reader who cannot see the page the way you do, so the check has to be made from that reader’s point of view: keyboard only, colour removed, or screen reader only.

How to check it

Measure the text against the brightest part of the photograph behind it.

  1. List every block of text that sits over a photograph
  2. Measure the text against the brightest part of the image behind it, aiming for 4.5:1
  3. Check the text where the photograph is lightest, not where it is darkest
  4. Confirm a scrim or shadow is used where the photograph varies
  5. Confirm the text still passes when the photograph is replaced by another image

Practice check: fictional Maple Corner

The table below is fictional practice material, with fictional values. It is the expected result for the practice page, worked out against the WCAG Understanding page, not a run of any accessibility tool.

Check As shown Result
Headline white text on a dark scrim, 7.8:1 Pass
Subheading white text on a dark scrim, 7.8:1 Pass
Button label white text on a dark button, 8.1:1 Pass
Caption white text on a dark strip, 7.2:1 Pass
Photo credit pale grey text on a bright sky, 2.1:1 Fail — darken the text or add a scrim to reach 4.5:1
Promo line white text straight on a bright beach photo, 1.8:1 Fail — add a dark scrim behind the text

Four of the six checks pass, and two fail. The passing checks show the design follows the rule in most places, but the two failing checks would block a reader on every visit if they went out unchecked.

Expected result. We checked the Maple Corner hero banner against WCAG 1.4.3 Contrast (Minimum). We did not run any accessibility tool on the page.

Limits

  • No accessibility tool was run on the Maple Corner hero banner, and Maple Corner is fictional. The table above is the expected result for the practice page, not a test of any product.
  • This guide checks one criterion on one page. A page that passes this check can still fail other criteria; check each rule separately.
  • Ratios in this guide are the thresholds from the WCAG Understanding page. A ratio of 4.499:1 fails a 4.5:1 requirement; ratios are not rounded.
  • It does not check the design’s brand colours. A design that passes this check can still use the wrong brand colour; check colours separately.

Sources

See all