Sub topic 10
Placing text directly over an image
This chapter assumes you know how typefaces, sizes and weights differ, and that you have met contrast and legibility, negative space, and the grid. Here you decide where text can sit on a photograph, and how to tell whether a spot works before you reach for overlays.
Why placement comes first
Putting text on an image is a decision with three parts: find a zone, check the zone, and style the text for that zone. Many weak layouts skip the first two and try to fix everything with a heavy dark box. A good placement often needs no fix at all.
The order matters because each step narrows the next one:
- Locate the focal point so text never covers it.
- Find a calm area with little detail and a fairly even tone.
- Check contrast between the text color and that area.
- Only then add help, such as a scrim, which the next chapter covers.
Finding a text zone
A text zone is an area of the image where type can sit without fighting the picture. Good zones share these traits:
- Low detail: sky, water, a blurred background, a wall, a field.
- Even tone: the brightness changes little across the area.
- Away from the focal point: faces, eyes and the main subject stay clear.
- Large enough: the zone holds the whole text block with margin to spare.
A quick test is to squint at the image, or blur it heavily in your design tool. Busy areas turn into noisy patches. Calm areas stay smooth. Place your text block on the smooth areas.
Edges of a photo are common zones, since photographers often leave space around a subject. The rule of thirds helps too. If the subject sits on one third line, the other two thirds often hold space for text.
Zone problems to watch for
- Uneven brightness inside the zone. A sky that goes from pale blue to white behind a headline can make one word readable and the next one not.
- Small bright or dark spots. A single bright window or a dark branch behind a letter breaks it up.
- Edges of objects. A horizon line or a building edge running through a line of text creates a visual tangle.
- Faces and eyes. Text over a face reads as a mistake, even if the contrast is fine.
Aligning text to the image and the grid
Text over an image still follows the grid. Pin the text block to a margin or column line, not to a loose spot that looks right by eye. Use the same margin on the image as elsewhere in the layout.
Align the text to a feature of the image when one exists. For example, left-align a headline to the same vertical line as a tree trunk or a doorway. That gives the text and image a shared structure. Do not align text to something that is not part of a stable edge, such as a cloud.
Alignment choices that tend to work:
| Text position | Works well when | Watch out for |
|---|---|---|
| Bottom left, left-aligned | The image has space at the bottom, such as ground or water | Bottom edge cropping that feels tight |
| Top, centered | There is open sky and a symmetric subject | Text close to the top trim or browser chrome |
| Left or right third | The subject sits on the opposite third | Ragged lines crossing a bright edge |
| Centered over the whole image | The image is soft, abstract, or heavily blurred | Subject hidden behind the text |
Sizing and weight for text on images
Images add noise, so type needs more strength than it would on plain white. Use these adjustments:
- Increase size. A headline over a photo often needs to be larger than the same headline on a plain background.
- Increase weight. A thin or light weight breaks apart on texture. Regular, medium or bold holds together better.
- Keep line length short. Short lines occupy a smaller area, so they are easier to fit in a calm zone.
- Increase leading slightly for body text. Tight lines pick up more of the texture around them.
- Avoid long paragraphs. Keep body text off the image whenever you can. Use a short headline and one supporting line instead.
Choosing the text color
Text color on an image has two jobs: be readable and relate to the image. Use white or near-white on dark zones, and dark on light zones. A color pulled from the image, such as a muted tone from the sky, ties the type to the picture, but only use it when the contrast still passes.
Sample the zone's real brightness, not the whole image. Zoom in and check the lightest and darkest parts of the area under the text. The text must pass against the worst part, not the average. For a quick numeric check, use a contrast checker with the lightest or darkest sample of the zone. Normal text should reach at least 4.5:1, and large text at least 3:1, the WCAG minimums covered in the accessibility chapter.
Shadows and outlines as a last resort
A soft drop shadow or a thin outline can help a little, but they are weak fixes. A shadow with a large blur and low opacity can add a bit of separation. A hard, dark shadow or a thick outline usually looks dated and can blur small text.
If the text needs a heavy effect to be readable, the zone is the problem. Move the text, recrop the image, or use a scrim instead.
Placing text in code
On a web page the same ideas apply. The text sits in a container over a background image, anchored to a calm zone. This example places white text at the bottom of the photo, where a gradient darkens the image.
.hero {
position: relative;
min-height: 24rem;
display: flex;
flex-direction: column;
justify-content: flex-end;
padding: 2rem;
color: #fff;
background:
linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0) 60%),
url("coast.jpg") center / cover no-repeat;
}Here justify-content: flex-end pins the text to the bottom of the box, which is the zone you chose. The padding gives the text a margin from the edge. The gradient is a scrim, a technique the next chapter covers in detail. The point for now is that the position comes from the zone decision, and the gradient supports it.
Note that background-position: center is set through the shorthand. If the focal point is not at the center of the photo, change the position so the subject stays clear of the text area as the box changes size.
Common errors
- Placing text first and checking later. Pick the zone, then test it.
- Centering by habit. Centered text often lands on the subject.
- Using a light weight. Thin strokes disappear over texture.
- Testing only one image. A template used with many photos needs a safeguard, such as a scrim, because a zone that works for one image will fail on another.
- Ignoring other formats. A zone at the bottom of a wide image may land on the subject in a square crop.
Review checklist
Before you move on, check each point:
- The text stays off faces and the main subject.
- The text sits on a calm, fairly even zone.
- The text block aligns to the grid and shares margins with the rest of the layout.
- Contrast passes against the lightest or darkest part of the zone.
- The text is large and heavy enough for the texture behind it.
- The layout still works at the smallest size it will be viewed.
Exercise
A photo of a lighthouse has the tower on the right third and a sky that fades from pale blue at the top to near white at the horizon. You want to place a white headline. Where would you put it, and what would you check first?
Show answer
Place the headline in the left two thirds, away from the tower, in the upper area where the sky is the bluest and darkest. Near the horizon the sky is almost white, so white text would fail there. Sample the lightest part of the sky under the text and check that white against it reaches at least 3:1 for a large headline. If it fails, move the text higher, darken the zone with a scrim, or switch to dark text on the pale zone.
Exercise
Your headline looks readable on a design monitor, but a colleague says it fades on their phone outdoors. Name two likely causes and one fix for each.
Show answer
First, the zone has uneven brightness, so some letters sit on a bright patch. The fix is to move the text to a more even area or recrop. Second, the weight is too light or the size too small for a small bright screen. The fix is to use a heavier weight and a larger size, then recheck the contrast against the lightest part of the zone.