Skip to main content
VVertex Solutions
All toolsPDF ToolsImage ToolsText ToolsCalculatorsDeveloperBlog
VVertex Solutions

Browse tools for merging and compressing PDFs, resizing and converting images, formatting text and JSON, running calculators, and working with code.

Popular Tools

  • Mortgage Calculator
  • GPA Calculator
  • Tip Calculator
  • BMI Calculator
  • Percentage Calculator
  • EMI Calculator
  • Merge PDF
  • JSON Formatter

Categories

  • All tools
  • PDF Tools
  • Image Tools
  • Text Tools
  • Calculators
  • Developer Tools

Company

  • About
  • About the Author
  • Editorial Standards
  • How We Verify Tools
  • How Data Is Processed
  • Calculator Comparisons
  • Disclaimer
  • Privacy Policy
  • Cookie Policy
  • FAQ
  • Accessibility
  • Changelog
  • Terms of Service
  • Contact
  • Blog
  • RSS Feed

© 2026 Vertex Solutions. All rights reserved.

Free tools. No signup. Privacy first.

  1. Home
  2. Blog
  3. WCAG Contrast When Text Appears on Images
SEOinformational4 min readPublished 2026-06-17 · Last updated 2026-10-23

WCAG Contrast When Text Appears on Images

Hero headlines and promo banners over photos often miss WCAG contrast ratios. How to measure the real background, then fix text-on-image patterns so they pass accessibility checks.

By Rehan Baqir

Quick answer

Text on a photo has to meet WCAG contrast against the image and any overlay behind the letters. Level AA requires 4.5:1 for normal text and 3:1 for large text (18pt or larger, or 14pt bold). A scrim or a solid panel makes that ratio predictable. A text shadow on its own does not pass reliably.

White type on a sunset photo fails as soon as the headline moves onto bright sky. One marketing hero, a mountain photo at sunset, failed the accessibility audit at every breakpoint where the text drifted onto that sky: contrast ratio 1.8:1. Legal contacted the team before launch. WCAG 2.1 Level AA requires 4.5:1 for normal text and 3:1 for large text, measured against the pixels behind the letters, overlays included. Photos change brightness from pixel to pixel, and a responsive crop moves the headline onto a different patch. Crop Image can move the busy part of the photo away from the type. A scrim or a solid panel is the more reliable fix when the crop still shifts.

WCAG basics for overlays

Contrast ratio is the relative luminance difference between text and background.

| Text size | AA minimum | AAA minimum | | --- | --- | --- | | Normal (< 18pt / 14pt bold) | 4.5:1 | 7:1 | | Large (≥ 18pt / 14pt bold) | 3:1 | 4.5:1 |

"Large text" means 18pt or larger, or 14pt bold or larger, measured in CSS pixels.

Why photos fail

  • Sky, snow, and sand blow out the highlights under white text
  • Dark foliage swallows black text
  • Responsive reflow moves the text onto a different part of the image
  • Compression artifacts change local contrast. See hero image weight budget

Fixes that pass

1. Scrim overlay

A semi-transparent rgba(0,0,0,0.5), or a gradient that darkens from the bottom toward the top. Measure the text color against the scrim and the image together. If the scrim opacity is high enough, sampling the scrim color alone is often enough.

2. Solid badge or panel

Put the headline on an opaque card. This pattern passes most often. It also looks less cinematic.

3. Text stroke and shadow

text-shadow helps legibility a little. It does not reliably pass WCAG without a scrim underneath. A shadow used as the only fix is a common miss.

4. Art-direct the image region

Crop the photo so the busy area sits away from the text. Use Crop Image, and design the mobile crop separately from the desktop crop.

5. Keep the words in HTML

Put real text in the DOM. Do not bake the headline into the hero JPG used for Open Graph image sizing. Screen readers and contrast tools need DOM text.

Testing workflow

  1. Design the mobile, tablet, and desktop breakpoints
  2. Sample contrast at each one, with browser DevTools and a contrast extension
  3. Test at 200% zoom, and check that the text does not land on an unreadable region
  4. Run an automated scan (axe, Lighthouse accessibility). These catch some failures
  5. Try the page outdoors on a phone at high brightness

Open Graph and social images

OG images are often flat graphics with text on them. The same contrast ratios apply if you are holding the brand to the same standard. Social images are not carved out of WCAG, and a marketing hero is still in scope for inclusion work.

Tool page heroes

Utility sites often use a screenshot as the hero. Helpful content on tool pages covers the page around that image. A dark-mode screenshot needs the same contrast check. See dark mode screenshots PNG.

Compression can change the reading

How image compression affects quality: banding in a scrim can produce a false contrast reading. Test after compression, on the file you will actually ship.

Documentation screenshots

Compressing screenshots for documentation: arrows and labels need enough contrast on both light and dark parts of the UI.

Automated and manual testing

axe and Lighthouse catch some contrast failures. A gradient hero still needs a person to sample several breakpoints. Colour Contrast Analyser (CCA) can eyedropper the composite of scrim plus image.

Design system tokens

Set a --hero-scrim-opacity token in the design system so designers are not tuning opacity per page. Test that token once against the brand photo set for AA.

Legal risk

ADA Title III web accessibility lawsuits increasingly cite contrast failures on marketing heroes. For a US-facing site with significant revenue, fixing the contrast costs less than a settlement.

Limitations

A single pixel of a background photo is an unreliable sample. Responsive cropping changes which part of the photo sits behind the headline on mobile and on desktop. Use a consistent dark scrim, or put the text in a solid container, and sample the worst region at each breakpoint.

Related Tools

Free browser-based tools referenced in this article.

Crop Image
Crop image by pixel bounds or an aspect-ratio preset, then download the cropped region.

Key takeaways

  • Text over an image has to meet contrast minimums against the effective background, including any overlay. Logo exceptions do not cover body text or headlines.
  • WCAG 2.1 Level AA requires 4.5:1 for normal text and 3:1 for large text (18pt or larger, or 14pt bold).
  • Test the lightest and darkest regions the text might cover if the layout shifts between breakpoints.
  • A dark or light scrim makes background luminance more uniform. A solid panel passes more reliably than a text shadow alone.

Frequently Asked Questions

Common questions answered to help you get the most from this tool.

Yes. Text placed over images has to meet contrast minimums against the effective background, usually the image area behind the text, including overlays. Decorative text in logos may have exceptions. Body text and headlines do not.

WCAG 2.1 Level AA requires 4.5:1 for normal text and 3:1 for large text (18pt or larger, or 14pt bold or larger). Level AAA is stricter. Many jurisdictions use AA as the baseline for public sites.

Test the worst-case region behind the text: the lightest and darkest areas the text might sit on if the layout shifts. Use a contrast checker with sampled colors, or a tool that treats the overlaid scrim as one background.

Yes. A dark or light scrim behind the text makes background luminance more uniform, so the ratio is easier to predict. A solid overlay block passes more reliably than a text shadow used on its own.

Indirectly. Accessibility affects usability, Core Web Vitals can move when layout changes to fix contrast, and there is legal compliance risk. Google describes accessible content as part of a helpful page experience.

About the author

Rehan Baqir is the founder & editor of Vertex Solutions. He builds browser-based tools and writes guides about PDF workflows, calculators, image tools, and developer utilities. Article pages show their publication and update dates when available. Read the editorial standards and tool-testing method for the site's stated approach to content and verification.

More about Rehan Baqir →

wcagaccessibilitycontrastseoweb-design
Back to all articles

On this page

  • WCAG basics for overlays
  • Why photos fail
  • Fixes that pass
  • 1. Scrim overlay
  • 2. Solid badge or panel
  • 3. Text stroke and shadow
  • 4. Art-direct the image region
  • 5. Keep the words in HTML
  • Testing workflow
  • Open Graph and social images
  • Tool page heroes
  • Compression can change the reading
  • Documentation screenshots
  • Automated and manual testing
  • Design system tokens
  • Legal risk
  • Limitations

Related Articles

  • What a context window actually holds
  • Embeddings and keyword search
  • Local models and API calls: what leaves the machine