Image contrast checker

Draw a box around text on a photo, screenshot or gradient. Get the contrast at its worst spot, not at one clicked pixel. A second mode checks where an AI label will sit on a picture.

Published . Last reviewed .

Your image never leaves your device. It is opened and measured inside this browser tab; nothing is uploaded, stored or sent. How to check that for yourself.

What do you want to check?

Measures text that is already part of the picture. Draw a box around it and the tool finds the contrast at the worst spot behind the letters.

1. Load an image

Drop an image here

or press Enter to choose a file, or paste an image from your clipboard (Ctrl+V or ⌘V)

PNG, JPEG, WebP, GIF or AVIF, up to 25 megapixels

What this tool can't do

  • It measures the pixels of the image you give it. A screenshot or export can differ from the live page, because scaling, color profiles and image compression all shift colors, so re-check anything borderline in the real thing. How WCAG applies to text over a varying background is a judgment call; this gives you the numbers across the whole box so you can make it.
  • It assumes one text color. Gradient text, outlined text and text with a shadow are not modeled: set the text color yourself and treat the result as approximate.
  • It cannot read. It does not know whether your box contains text, only which colors are in it.
  • The color it detects by itself is a guess about which color is the lettering, and it can be wrong, so it is only a suggestion: until you confirm it or set the color yourself, the result says "if the text is …" and is not a verdict. Check the suggestion against the letters before you confirm it. If it is even slightly off, type the exact color instead: a pale patch behind some white words can be suggested in place of the white, and confirming it measures the patch.
  • Anti-aliased letter edges are removed with a heuristic. Thin lines, grids, pinstripes and fine texture in a photo look like the soft edges of letters up close, so they can be set aside with them, and so can a thin ring of background hugging each letter. Failing detail that runs unbroken right across the box cannot be lettering, so when any of it was set aside away from the letters, the result is not a plain pass and gives both figures. That includes a rule or border drawn in the text color: the tool cannot tell it from a bright line in a photo, so draw the box to leave it out. Other set-aside detail, such as specks, short marks or texture in one part of the box, changes the result only when counting it would add more than 5 percentage points to the failing share, because thin or light lettering looks the same. Below that it can still pass, and so can detail right beside a letter, which is set aside with the letter.
  • If the text color also appears in the background, such as white text over a white sky, those areas cannot be told from the letters and are not measured. An area of that color too wide to be part of a letter is flagged in the result; a smaller one is not, and neither is one in a box that holds nothing else to compare it with. A solid shape in the text color standing apart from the letters is flagged too, because it could be a patch hiding a word; the result says it may instead be an icon or a bullet.
  • A box with more than 1,000,000 pixels is measured on a regular grid, not pixel by pixel, so a speck or a line thinner than the grid spacing can be missed.
  • Images over 25 megapixels are refused, and a phone may run out of memory on smaller ones. Transparent pixels are measured as if they sat on white.
  • It checks text contrast only (WCAG 1.4.3 and 1.4.6): not interface components, not hover or focus states, and not whether the text should be an image at all. A pass is a measurement of one image, not a statement that a page meets any standard or law, and it isn't legal advice.
  • AI label mode measures a label you describe, not one it can see. It takes the colors and opacity you type and compares them with the pixels of the corner you choose, with nothing set aside. It does not know the label's shape, edges, outline, shadow or panel. If the label sits on a panel, enter the panel color as the icon color, and check the lettering against the panel with the color contrast checker.
  • AI label mode cannot tell whether a picture is AI-generated, and it does not decide whether a picture needs a label. It reads pixels and the colors you give it. For which rules may apply to you, use the AI disclosure rules finder.
  • The ratios in AI label mode are WCAG's, used as a yardstick. In our reading, the EU Code of Practice and the Commission's icons page name no contrast ratio or size for an AI label, and WCAG 1.4.3 sets no requirement for text that is part of a picture with significant other visual content. So a result here says how visible a label is on this picture. It does not say that a label meets the Code or Article 50 of the AI Act, and it isn't legal advice.

How the worst case is measured

  1. Pick the pixels

    Your box is read from the image. If it holds more than 1,000,000 pixels, the tool measures a regular grid of them instead, so large images stay quick: every Nth pixel in each direction, using the smallest N that keeps the grid within 1,000,000 points. For a whole 12-megapixel phone photo (4032 × 3024) that is every 4th pixel, and the result says which spacing it used. Nothing outside your box is read.

  2. Find the text color

    Unless you set it, the tool splits the box's pixels into the two color groups that describe them best and takes the smaller group as the text, because letters usually cover less of a box than what is behind them. It also scores how clear that split is, and checks that neither group hides a third color, such as a dark building beside a headline on a pale sky, which would make "the smaller group" meaningless. If it cannot tell the text from the background it says so and asks for the color. When it can, the color is still only a suggestion: the result is worded "if the text is …", with no pass or fail, until you confirm the color with one button or set it yourself.

  3. Set aside the letters and their soft edges

    Pixels that match the text color are the letters. The anti-aliased pixels along their edges are blends of text and background, so they are always lower in contrast than the background itself, and counting them would make every piece of text fail somewhere. They are set aside: pixels touching a letter, and blended pixels one step further out. A smooth stretch of background is never set aside just for looking like a blend, so the dark end of a gradient still counts. Thin lines, grids and fine texture are different: up close they look like the soft edge of a thin letter. The result says so and gives both figures instead of a plain pass when failing detail like that runs unbroken across the box and some of it has no letter near it, or when counting it as background would add more than 5 percentage points to the failing share. It does the same when an area of the text color is too wide to be a letter.

  4. Measure what is left

    Every remaining background pixel gets a WCAG contrast ratio against the text color. You see the worst ratio, the 5th percentile, the median and the share of the background below your threshold. The verdict only says "passes everywhere" if every measured pixel passes, nothing set aside would change that, and the text color is one you set or confirmed: a median that passes while a third of the box fails is not a pass.

What the thresholds mean

WCAG 2.2 contrast minimums for text, as the size and level options above use them
Text sizeLevel AALevel AAA
Normal text4.5:17:1
Large text3:14.5:1

These come from WCAG success criteria 1.4.3 Contrast (Minimum) and 1.4.6 Contrast (Enhanced). Large text is at least 18 point (24px), or at least 14 point (about 18.7px) and bold.

AI label mode measures a label's lettering against the same text ratios, and its icon against the 3:1 that WCAG success criterion 1.4.11 Non-text Contrast sets for graphics needed to understand content.

Checking where an AI label will sit

In Section 2 of the EU's Code of Practice on transparency of AI-generated content, which the Commission found adequate on July 8, 2026, signatories that publish deep fakes commit to put the label or icon "in an appropriate place where no intervening overlay elements exist (e.g., in the top right corner of an image or video deep fake)", to keep it visible "against any background", and to provide "high contrast icons or equivalent labels and screen-reader compatibility" (Measures 1.1 and 1.2). The Code binds only the organizations that signed it, and the Commission's guidelines on Article 50 are not binding either.

AI label mode measures the part of that which pixels can tell you: how well your label's colors stand out at the weakest spot of the area it will cover. We checked these sources on October 21, 2026. This is general information, not legal advice.

How to use it

  1. Choose "An AI label on an image" and load the picture the label will go on. Nothing is uploaded.
  2. Pick a corner, or drag a box on the picture. The top right comes first because it is the Code's example.
  3. Enter the label's size, its distance from the edges, and the color of its text and of its icon, with an opacity for each if it is see-through.
  4. Read the weakest spot for each color, the table that compares all four corners, and the label's height as a share of the picture's shortest side.

What it does not decide

The Code says the label "may appear in different sizes depending on the context", as long as the disclosure is clear and distinguishable. In our reading, neither the Code nor the Commission's icons page names a minimum size or a contrast ratio. So the label's height is shown as a share of the picture's shortest side, as a measurement, and nothing is checked against it.

WCAG 1.4.3 sets no contrast requirement for text that is part of a picture with significant other visual content, so a label drawn into a photo can be exempt from WCAG and still be hard to see. The Code's test is visibility, which is why this mode reports the weakest spot as numbers and says "reaches" or "below" a reference ratio, not pass or fail. For wording, placement and the screen reader side, read Accessible AI labels, and use the accessible AI label generator to write label text and markup with the text equivalent included. For whether a picture needs a label at all, start with the AI disclosure laws hub.

Why a box and not a pixel

Worst case, not a sample

A reader cannot choose which part of the background a word lands on. The lowest-contrast spot behind the text is where it becomes hard to read, so that is the number this leads with.

Where, not just whether

A heat map on the image and a plain-text table show which part of the box fails, so you know what to move or darken. Neither relies on color alone.

Nothing leaves your device

There is no upload, no account and no server doing the maths, so a screenshot of an unreleased design never goes anywhere.

Questions

Does my image get uploaded?

No. The image is decoded and measured in this browser tab, and there is no server-side processing: the maths is in two script files you can read, image-contrast-ui.js and image-contrast.js. To check for yourself, open your browser's developer tools, switch to the Network tab and load an image. Apart from this page's own files and its web font when the page first opens, nothing is requested.

Why does it report the worst case instead of an average?

An average or a median can pass while a third of the box fails. The tool reports the worst ratio, the 5th percentile and the median, and the share of the background that fails your threshold, and it only says a box passes if every measured pixel does.

Why do I have to confirm the text color?

Because the detected color is the tool's guess at which color is the lettering, and a wrong guess gives a wrong answer that looks just as sure as a right one. In our own testing, white text on a sky fading from blue to pale, beside a dark building, was taken to be the color of the building, and measured with that color the box passed, although most of the background behind the real text failed. So until you press "Yes, the text is …", type the color, pick it from the image or use the eyedropper, the result says "if the text is …" and gives no pass or fail.

Why does it say it cannot find the text color?

Automatic detection assumes the box holds two main colors and that the smaller one is the text. A photo or a gradient is a smear of colors rather than two groups, a box that is half letters and half background has no clear minority, and a box that also catches a third color, such as a building, a button or the page around a banner, has no single smaller group to pick. In those cases it asks you instead of offering a suggestion: click a letter on the image, type the color, or use the eyedropper if your browser has one.

What can I do if it fails?

Common fixes are a solid or semi-transparent panel behind the text, darkening or lightening the part of the image behind it, moving the text to a calmer part of the image, or changing the text color. Where one color would pass against everything in your box, including anything it set aside and was unsure about, the result lists it. Text shadows and outlines are not modeled, so if you rely on one, judge the result by eye as well.

Can I check a PDF or a design file?

Screenshot or export the page or frame as an image and load it here. For the structure of a PDF, such as its tags and language, use our PDF accessibility checker.

What about contrast on a live page?

For two flat colors, use our color contrast checker. For text on a live page, our free accessibility bookmarklet measures the rendered contrast in your own browser, on the page you are looking at.

What does AI label mode measure?

It compares the colors you enter for a label's text and icon with every sampled pixel of the corner you choose, and reports the weakest spot for each, the share of the area that falls below the reference ratio, all four corners side by side, and the label's height as a share of the picture's shortest side. It does not see your actual label, and it cannot tell whether a picture is AI-generated.

Is there a minimum size or contrast for an AI label?

In our reading, no. The EU Code of Practice says a label may appear in different sizes depending on the context as long as the disclosure is clear and distinguishable, and it asks for high contrast icons or equivalent labels without naming a ratio. The Commission's icons page names neither a size nor a ratio. The ratios used here are WCAG's, as a yardstick, and the height share is a measurement with no threshold. The Code binds only the organizations that signed it. We checked these sources on October 21, 2026, and this is not legal advice.

Does a label drawn into the picture need alt text?

A screen reader cannot read pixels, so the words of a label drawn into the picture need a text equivalent somewhere else. WCAG 1.1.1 asks for a text alternative for non-text content, and the Commission's icons page says that, if possible, the icon should be readable by assistive technologies using alt text or ARIA labels. Whether the picture's own alt text should also say it is AI-generated is a separate question that nobody has settled: see should alt text say an image is AI-generated.

Contrast is one check; what the picture says is another

Color is only half of what an image does on a page. GotAlt's alt text checker downloads the actual image file and compares it to the words with a vision model.

Check if my alt text is actually right

Contrast is one check of many

The free scan runs 16 rule-based WCAG checks on up to 3 pages of your site: missing alt text, form labels, headings, page language, link text and more. No signup.

Scan my site for free