{"course":{"slug":"design-foundations","title":"Design, before Any Software","url":"https://addaly.com/learn/design-foundations","level":"beginner","track":"create"},"lesson":{"slug":"text-over-image","title":"Text over a picture you do not control","url":"https://addaly.com/learn/design-foundations/text-over-image","position":54,"of":74,"minutes":9,"answer":"An image has no single contrast ratio, so the worst pixel under the text governs legibility. And because the image is usually unknown in advance.","keyIdea":"An image has no single contrast ratio, so the worst pixel under the text governs legibility. And because the image is usually unknown in advance, a solid panel or a multi-stop gradient scrim is the robust choice and a text shadow alone is not."},"body":{"format":"markdown","text":"## Why this is harder than it looks\n\nA contrast ratio is computed between two colours. An image has thousands. So there is no single ratio for white text over a photograph, and the requirement still applies, which means, in practice, that the **worst pixel under the text** governs whether it is legible.\n\nThis would be manageable if you chose every image. Usually you do not. The image comes from a content management system, a user upload, a client's library, or a stock search performed by somebody else six months from now. The design has to work for an image nobody has seen yet.\n\nThat constraint rules out the most elegant solution and forces one of the robust ones.\n\n## Five approaches, from best to worst\n\n**1. Put the text in a plain region of the image.** Costs nothing, looks best, and only works when you control the image. A sky, a wall, a shallow-focus background. If you are art-directing a specific photograph, brief for it: ask for space in the frame.\n\n**2. A solid panel behind the text.** The most reliable option available. The ratio becomes computable because the text sits on a known colour. It looks deliberate rather than apologetic, and it is what newspapers and posters have always done. The objection is that it covers part of the image, which is only an objection if the image is more important than the words.\n\n**3. A gradient scrim.** A gradient from transparent to dark, over the region carrying the text. The standard compromise, and it works because it is strongest exactly where the text is and disappears where it is not.\n\n```css\n.hero::after {\n  content: '';\n  position: absolute;\n  inset: 0;\n  background: linear-gradient(\n    to top,\n    rgb(0 0 0 / 0.75) 0%,\n    rgb(0 0 0 / 0.45) 25%,\n    rgb(0 0 0 / 0) 55%\n  );\n}\n```\n\nThree stops rather than two matters: a straight two-stop gradient has a visible linear ramp that reads as a band. Easing it with an intermediate stop makes it look like light rather than like a rectangle.\n\n**4. A full overlay.** A flat dark layer over the whole image at 40 to 60%. Reliable, and it dulls the photograph everywhere including where nothing needed dulling. Acceptable when the image is atmosphere rather than content.\n\n**5. Text shadow.** The weakest, and the one reached for first. A shadow adds a dark halo around each glyph, which helps marginally against a light background and makes the text look muddy at any size. It also fails completely on a busy background, where the halo merges with the detail. Use it as a small addition to one of the above, never on its own.\n\nA sixth option worth knowing: `backdrop-filter: blur(12px)` blurs whatever is behind an element, which turns a busy background into a smooth one under the text while leaving the rest of the image sharp. Support is now broad, it is expensive to render on low-end devices, and it needs a translucent background colour alongside it to guarantee the ratio.\n\n## Checking the worst case\n\nA routine that takes a minute:\n\n1. Find the lightest pixel in the region under white text, using the colour picker in any editor.\n2. Compute the ratio against your text colour.\n3. Repeat with the darkest pixel if your text is dark.\n\nThen do it again with the worst plausible image rather than the chosen one: a white sky, a snow scene, a photograph of a document. If the design holds for that, it holds.\n\nFor a system where images are uploaded by users, the honest answer is that a scrim tuned to a nice photograph will fail on somebody's picture of a whiteboard, and the panel is the correct choice.\n\n## Placement\n\nTwo practical points that reduce how much scrim you need in the first place.\n\n**Put the text where the image is already quiet.** Even with an unknown image, the bottom of a photograph is more often darker and less detailed than the middle, which is why so many cards put their text there.\n\n**Keep text out of the centre.** The centre is where the subject usually is, so text there covers the subject and sits on the busiest region. Top and bottom bands are safer on both counts.\n\n## The accessibility position\n\nWCAG applies to text over images exactly as it applies to text on a flat background, and there is no exemption for decorative photography. If the text is content, it needs its ratio.\n\nWhat the guidelines do not require is that the image be unaltered. A scrim is a legitimate solution, a panel is a legitimate solution, and moving the text off the image entirely is a legitimate solution. The one thing that is not available is deciding that a photograph is more important than whether people can read the words on it."},"check":{"question":"A card component places white text over user-uploaded photographs with a two-stop gradient scrim tuned against the sample images. Complaints arrive about unreadable cards. What is the most defensible fix?","options":[{"text":"Add a text shadow beneath the white text, which will preserve the photographs while restoring legibility on the lighter uploads.","correct":false,"tempting":"Reaches for the weakest device, which produces a muddy halo and fails entirely against detailed light backgrounds."},{"text":"Replace the scrim with a solid panel behind the text, so the ratio is computable regardless of what is uploaded.","correct":true},{"text":"Increase the scrim's opacity until it passes against a pure white background, which is the worst case any upload can present.","correct":false,"tempting":"Solves for the worst case by darkening every image so heavily that the photograph stops being visible at all."},{"text":"Add a third stop to the gradient so it eases rather than ramping linearly, which removes the visible band and strengthens the darkest region under the text.","correct":false,"tempting":"Applies a real refinement to gradient construction that improves appearance without guaranteeing a ratio against an unknown image."}]},"prev":{"slug":"two-subjects-fighting","title":"Two focal points is none","url":"https://addaly.com/learn/design-foundations/two-subjects-fighting"},"next":{"slug":"rhythm-repetition-and-the-break","title":"Repetition, and the one that breaks it","url":"https://addaly.com/learn/design-foundations/rhythm-repetition-and-the-break"},"authorship":"Founder and series editor: Dr Mustafa Mun. Written by AI models to a written standard. Source and assessment review continues. Academic review invited.","review":{"status":"Draft, open for academic review"},"cite":"Addaly (2026) 'Text over a picture you do not control', in Design, before Any Software. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/design-foundations/text-over-image (Accessed: 29 November 2026).","licence":{"name":"CC BY-NC-SA 4.0","url":"https://creativecommons.org/licenses/by-nc-sa/4.0/"},"reader":{"schema":1,"title":"Text over a picture you do not control","courseTitle":"Design, before Any Software","module":{"index":5,"slug":"composition-and-the-image","title":"Composition and the image"},"answer":null,"keyIdea":"An image has no single contrast ratio, so the worst pixel under the text governs legibility. And because the image is usually unknown in advance, a solid panel or a multi-stop gradient scrim is the robust choice and a text shadow alone is not.","hero":{"kind":"plate","image":null,"alt":null,"caption":null},"blocks":[{"t":"h2","id":"why-this-is-harder-than-it-looks","runs":[{"text":"Why this is harder than it looks"}]},{"t":"p","runs":[{"text":"A contrast ratio is computed between two colours. An image has thousands. So there is no single ratio for white text over a photograph, and the requirement still applies, which means, in practice, that the "},{"text":"worst pixel under the text","b":true},{"text":" governs whether it is legible."}]},{"t":"p","runs":[{"text":"This would be manageable if you chose every image. Usually you do not. The image comes from a content management system, a user upload, a client’s library, or a stock search performed by somebody else six months from now. The design has to work for an image nobody has seen yet."}]},{"t":"p","runs":[{"text":"That constraint rules out the most elegant solution and forces one of the robust ones."}]},{"t":"h2","id":"five-approaches-from-best-to-worst","runs":[{"text":"Five approaches, from best to worst"}]},{"t":"p","runs":[{"text":"1. Put the text in a plain region of the image.","b":true},{"text":" Costs nothing, looks best, and only works when you control the image. A sky, a wall, a shallow-focus background. If you are art-directing a specific photograph, brief for it: ask for space in the frame."}]},{"t":"p","runs":[{"text":"2. A solid panel behind the text.","b":true},{"text":" The most reliable option available. The ratio becomes computable because the text sits on a known colour. It looks deliberate rather than apologetic, and it is what newspapers and posters have always done. The objection is that it covers part of the image, which is only an objection if the image is more important than the words."}]},{"t":"p","runs":[{"text":"3. A gradient scrim.","b":true},{"text":" A gradient from transparent to dark, over the region carrying the text. The standard compromise, and it works because it is strongest exactly where the text is and disappears where it is not."}]},{"t":"code","lang":"css","label":"CSS","text":".hero::after {\n  content: '';\n  position: absolute;\n  inset: 0;\n  background: linear-gradient(\n    to top,\n    rgb(0 0 0 / 0.75) 0%,\n    rgb(0 0 0 / 0.45) 25%,\n    rgb(0 0 0 / 0) 55%\n  );\n}"},{"t":"p","runs":[{"text":"Three stops rather than two matters: a straight two-stop gradient has a visible linear ramp that reads as a band. Easing it with an intermediate stop makes it look like light rather than like a rectangle."}]},{"t":"p","runs":[{"text":"4. A full overlay.","b":true},{"text":" A flat dark layer over the whole image at 40 to 60%. Reliable, and it dulls the photograph everywhere including where nothing needed dulling. Acceptable when the image is atmosphere rather than content."}]},{"t":"p","runs":[{"text":"5. Text shadow.","b":true},{"text":" The weakest, and the one reached for first. A shadow adds a dark halo around each glyph, which helps marginally against a light background and makes the text look muddy at any size. It also fails completely on a busy background, where the halo merges with the detail. Use it as a small addition to one of the above, never on its own."}]},{"t":"p","runs":[{"text":"A sixth option worth knowing: "},{"text":"backdrop-filter: blur(12px)","code":true},{"text":" blurs whatever is behind an element, which turns a busy background into a smooth one under the text while leaving the rest of the image sharp. Support is now broad, it is expensive to render on low-end devices, and it needs a translucent background colour alongside it to guarantee the ratio."}]},{"t":"h2","id":"checking-the-worst-case","runs":[{"text":"Checking the worst case"}]},{"t":"p","runs":[{"text":"A routine that takes a minute:"}]},{"t":"ol","start":1,"items":[[{"text":"Find the lightest pixel in the region under white text, using the colour picker in any editor."}],[{"text":"Compute the ratio against your text colour."}],[{"text":"Repeat with the darkest pixel if your text is dark."}]]},{"t":"p","runs":[{"text":"Then do it again with the worst plausible image rather than the chosen one: a white sky, a snow scene, a photograph of a document. If the design holds for that, it holds."}]},{"t":"p","runs":[{"text":"For a system where images are uploaded by users, the honest answer is that a scrim tuned to a nice photograph will fail on somebody’s picture of a whiteboard, and the panel is the correct choice."}]},{"t":"h2","id":"placement","runs":[{"text":"Placement"}]},{"t":"p","runs":[{"text":"Two practical points that reduce how much scrim you need in the first place."}]},{"t":"p","runs":[{"text":"Put the text where the image is already quiet.","b":true},{"text":" Even with an unknown image, the bottom of a photograph is more often darker and less detailed than the middle, which is why so many cards put their text there."}]},{"t":"p","runs":[{"text":"Keep text out of the centre.","b":true},{"text":" The centre is where the subject usually is, so text there covers the subject and sits on the busiest region. Top and bottom bands are safer on both counts."}]},{"t":"h2","id":"the-accessibility-position","runs":[{"text":"The accessibility position"}]},{"t":"p","runs":[{"text":"WCAG applies to text over images exactly as it applies to text on a flat background, and there is no exemption for decorative photography. If the text is content, it needs its ratio."}]},{"t":"p","runs":[{"text":"What the guidelines do not require is that the image be unaltered. A scrim is a legitimate solution, a panel is a legitimate solution, and moving the text off the image entirely is a legitimate solution. The one thing that is not available is deciding that a photograph is more important than whether people can read the words on it."}]}],"check":{"question":[{"text":"A card component places white text over user-uploaded photographs with a two-stop gradient scrim tuned against the sample images. Complaints arrive about unreadable cards. What is the most defensible fix?"}],"options":[{"text":[{"text":"Add a text shadow beneath the white text, which will preserve the photographs while restoring legibility on the lighter uploads."}],"correct":false,"tempting":[{"text":"Reaches for the weakest device, which produces a muddy halo and fails entirely against detailed light backgrounds."}]},{"text":[{"text":"Replace the scrim with a solid panel behind the text, so the ratio is computable regardless of what is uploaded."}],"correct":true,"tempting":null},{"text":[{"text":"Increase the scrim’s opacity until it passes against a pure white background, which is the worst case any upload can present."}],"correct":false,"tempting":[{"text":"Solves for the worst case by darkening every image so heavily that the photograph stops being visible at all."}]},{"text":[{"text":"Add a third stop to the gradient so it eases rather than ramping linearly, which removes the visible band and strengthens the darkest region under the text."}],"correct":false,"tempting":[{"text":"Applies a real refinement to gradient construction that improves appearance without guaranteeing a ratio against an unknown image."}]}],"order":[3,2,1,0],"why":null},"prev":{"slug":"two-subjects-fighting","title":"Two focal points is none","minutes":8},"next":{"slug":"rhythm-repetition-and-the-break","title":"Repetition, and the one that breaks it","minutes":8}}}