Image Contrast Checker
Is your text readable over a photo, banner or screenshot? Open or paste the image, then drag a box around the text. You get a yes or no for WCAG, the weakest spot circled, and the overlay or text color that fixes it.
or drag and drop it here
PNG, JPG, WebP or GIF (max. 20MB)
…or paste a screenshot with Ctrl+V (⌘+V on a Mac). To check a web page, take a screenshot of it and open or paste it here.
How it works
Finding the text. Contrast under WCAG depends only on luminance, so the pixels inside your box are split by luminance into two groups with Otsu’s method. Letters are thin strokes and backgrounds are solid areas, so the group made of thinner shapes is taken as the text. A patch of the background as light as the letters, such as the sun or a reflection, is much thicker than a stroke and is put back into the background, so the hardest part of the background is not lost. Most pixels of a thin letter are blended with the background by anti-aliasing and image compression, so the text color is taken from the far end of the text pixels: the 2% farthest from the background are skipped as compression artifacts, and the next 6% are averaged. That is the core color of the letter, close to what W3C technique G18 asks for (two pixels in from the edge).
Which background counts. W3C failure F83 checks the background behind each letter, and technique G18 measures the background pixels next to the letter. So only background within about three stroke widths of the letters is measured, and a loose box with empty margins gives the same result as a tight one. The one-pixel ring touching the letters is left out, because anti-aliasing blends it with the text; measuring starts from the next pixel out.
The ratio. The ratio is computed with the WCAG 2 formula between the text color and each measured background pixel. Semi-transparent text, typed as rgba(), is first blended over each pixel the way a browser blends it. The worst 10% is the 10th percentile: nine background pixels in ten are at least that good. The red overlay shows the background pixels below the target you chose, 4.5:1 for normal text or 3:1 for large text.
The weakest spot. The weakest spot is the weakest patch of background, not the weakest single pixel. Each background pixel whose eight neighbors are also background is replaced by the median luminance of that 3×3 block, and the lowest ratio among them is circled. A lone noisy pixel or a line one pixel wide cannot win; at least five pixels of the block have to be that weak. WCAG sets no statistic for a photo, and the worst 10% is looser than the per-letter check in F83, so the verdict and the badges use whichever is lower, the spot or the worst 10%. Readers can lose letters at a weak spot even when the rest of the image is fine.
APCA. APCA Lc is computed for the text color against the same background pixels with the apca-w3 package, unmodified, and shown with its sign: negative means light text on a dark background. As with the ratio, the weaker of the circled spot and the weakest 10% (by the size of Lc) sets the APCA level and the minimum font sizes, so a line that vanishes over one part of the image cannot pass APCA on the rest. As with the WCAG ratio, summing up the pixels this way is our method; APCA itself compares two solid colors.
When the result can mislead
- If the guess is wrong, for example very bold text in a tight box, press “Swap” or set the text color by hand.
- Very thin or tiny text gives few text pixels, so draw the box around just that text.
- In a JPEG or a scaled-down screenshot the text color is an estimate; if you know the real color, type it in.
- Semi-transparent text changes color over each part of the image. Type its CSS color, such as rgba(255, 255, 255, 0.75), and it is blended over each pixel; otherwise the checker uses one color, taken from the core of the letters.
- Gradient or textured text is measured by its most contrasting part, so the result can be better than the weakest letter really is.
- The weakest spot is looked for at least two pixels from the letters, and a dark gap narrower than about two pixels is smoothed away; in a small screenshot, check the letters themselves too.
- The APCA font sizes are for the text as it appears on the page, so compare them with the CSS size, not with the size in a scaled screenshot.
- Text with its own shadow or outline is measured against the background, not the shadow, so the real contrast may be better than shown.
Your image stays on your device
The image is processed in your browser. Nothing is uploaded or stored.
Image contrast checker: questions
- How do I check the contrast of text on an image?
- Open the image or paste a screenshot, then drag a box around the text (or move it with the arrow keys and press Enter). The checker separates the letters from the background and measures the WCAG contrast ratio of the text color against every background pixel near the letters. It shows the weakest spot, the worst 10% of the background and the typical background, and gives a yes or no for WCAG AA.
- What contrast ratio does text over an image need?
- The same as any text under WCAG 2: at least 4.5:1 for normal text and 3:1 for large text (24px, or 18.66px bold) at level AA; 7:1 and 4.5:1 at level AAA. Over a photo the background changes from pixel to pixel, so the text has to reach the ratio against the lighter (or darker) parts too, not only on average.
- Why does the checker show several ratios?
- One ratio needs one background color, and a photo has hundreds. The typical background (median) shows how the text does on most of the image; the worst 10% shows the hardest tenth; the weakest spot, circled on the image, is the single weakest patch. WCAG does say how to test text over an image: W3C failure F83 checks the background behind each letter, and technique G18 measures the background pixels next to the letter. It sets no statistic for a whole photo. A worst-10% figure is looser than that per-letter check, and the weakest spot is the closer match. So the verdict and the badges use whichever of the two is lower.
- Does it show APCA contrast too?
- Yes. Below the WCAG result, the checker gives the APCA Lc value of the text color against the same background pixels: the weaker of the circled spot and the weakest 10%, and the median, with the sign that shows polarity, the APCA level and the minimum font size at weights 300, 400 and 700. If the text is lighter than part of the background and darker than the rest, both sides are shown. Lc comes from the apca-w3 package; summing up the pixels this way is our method for images, not part of APCA. APCA is in public beta and is not part of WCAG 2.x, so use the WCAG verdict for compliance.
- How do I fix text that fails over an image?
- Put a semi-transparent layer, often called a scrim, over the image and under the text. The checker tries a black and a white layer and gives the one that needs the lower opacity to make the weakest part pass, as a ready CSS line and as steps for Canva or Figma. It then measures the background again with the layer and tells you how much of it still falls short. It also shows the ratio white and black text would reach, in case changing the text color is easier. A solid box behind the text also works.
- Can I check the contrast of a whole website?
- Take a screenshot of the page and paste it here with Ctrl+V or ⌘+V, then select the text you are unsure about, such as a hero headline over a photo. For text on solid colors, the contrast checker with two HEX values is faster.
- Is my image uploaded?
- No. The image is read and measured in your browser. Nothing is sent to a server or stored.
Sources
- W3C (2018, current edition 6 May 2025). Web Content Accessibility Guidelines (WCAG) 2.1: definitions of relative luminance and contrast ratio, success criteria 1.4.3 and 1.4.6. Link
- W3C. Technique F83: Failure of Success Criterion 1.4.3 and 1.4.6 due to using background images that do not provide sufficient contrast (test procedure: the background behind each letter). Link
- W3C. Technique G18: Ensuring that a contrast ratio of at least 4.5:1 exists between text (and images of text) and background behind the text (test procedure: background pixels immediately next to the letter). Link