Sub topic 1
What the photo is for
Prerequisites
This chapter assumes you know the basics of the img element and its attributes, and basic CSS (selectors, width, height). You should also be comfortable with responsive layouts and breakpoints. No image editing skills are needed here. This chapter is about the decision that comes before any cropping or markup: why a photo is on the page at all.
Why start with purpose
Most photo problems on websites are not technical. A sharp, well-compressed image can still be the wrong image. It can repeat what the text already says, push the call to action below the fold, or crop badly on a phone because nobody decided what it was supposed to show.
Every later chapter in this tutorial depends on the answer to one question: what job does this photo do on this page? Selection, cropping, text overlays, alt text, and file size are all choices that follow from the job. If the job is unclear, those choices are arbitrary.
The common jobs a photo does
A photo on a web page usually does one of a small number of jobs. Naming the job lets you test the photo against it.
| Job | What the photo does | Typical placement | Example |
|---|---|---|---|
| Inform | Shows something the reader needs to see to understand | Inline with article text, product galleries | A close-up of a product's stitching |
| Persuade | Builds trust or desire so the reader acts | Hero banners, landing pages, team pages | A smiling support team on a contact page |
| Set mood | Establishes tone and brand before any reading | Full-width backgrounds, section openers | A misty hillside behind a retreat's headline |
| Orient | Shows where or what something is | Location pages, case studies | The storefront from the street |
| Prove | Gives evidence that a claim is real | Testimonials, before/after sections, reviews | A customer's finished kitchen |
| Decorate | Fills space with no information of its own | Spacer areas, background texture | A generic abstract pattern |
Most photos do more than one job, but one is usually primary. A hero image on a bakery's home page might set mood and persuade. A photo in a recipe step informs. The primary job decides what you protect when you crop and what you can afford to lose.
Content or decoration
The most useful split is between photos that carry information and photos that only decorate. It affects three things you will meet later.
- Alt text. An informative photo needs a description that conveys what it shows. A purely decorative photo should have an empty
alt=""so screen readers skip it. - Cropping tolerance. If the information is in a specific part of the frame, such as a product label, a face, or a gesture, the crop must never remove it. A decorative texture can be cropped almost anywhere.
- Effort and weight. A photo that carries the message deserves careful selection and several crops. A decorative one may not deserve to be on the page, since it costs bandwidth for no benefit.
The same picture can switch categories depending on context. A photo of a loaf of bread is informative on a recipe page that says "the crust should look like this". On a page where the loaf only fills a corner, it is decoration.
<!-- Informative: the description matters -->
<img src="crust-example.jpg" width="800" height="600"
alt="Loaf with a deep brown, blistered crust and a visible ear along the score">
<!-- Decorative: screen readers skip it -->
<img src="flour-texture.jpg" width="800" height="200" alt="">Matching the photo to the message
A page has a message: the one thing a visitor should understand or do. The photo should support that message, not compete with it. Check four relationships.
- Photo and headline agree. If the headline promises "Fast, friendly repairs", a photo of an empty workshop works against it. A technician handing a phone back to a customer works with it.
- Photo and audience agree. People look for themselves in photos. A fitness page showing only one kind of body or age can quietly tell many visitors the product is not for them.
- Photo and action agree. On a page that asks for a sign-up, the photo should point toward the form, not away from it. Gaze direction, leading lines, and where the subject sits in the frame all steer attention.
- Photo and truth agree. Generic stock photos of people in suits shaking hands rarely persuade. Photos of the real product, place, or team usually do better, because visitors can sense the difference.
Where the photo sits changes the requirement
The same photo behaves differently depending on its slot. Decide the slot before choosing the photo, because the slot fixes the shape, size, and what text may sit on top of it.
- Hero image. Large, near the top, seen first. It sets tone and usually has a headline over or beside it. It needs a wide crop on desktop and a different crop on phones, and it needs room for text.
- Inline image. Sits within reading content. It should earn its space by informing or illustrating a specific point. It usually spans the content column width.
- Card or thumbnail. Small, often a fixed shape such as a square or 4:3, repeated in a grid. Fine detail is lost, so the subject must be readable at small size.
- Background. Sits behind other content. Contrast and calm areas matter more than detail.
A photo that is excellent as a wide hero may be useless as a square thumbnail, because the subject becomes a tiny part of a mostly empty frame. Planning for the smallest and most extreme slot first avoids surprises.
flowchart TDThe diagram below summarizes the decision order this tutorial follows.
Write a one-sentence brief
A short written brief makes the purpose testable. Use this template:
> This photo should make [audience] feel or understand [message], in the [slot], so they [action].
For example: "This photo should make first-time visitors trust that real bakers work here, in the home page hero, so they click 'Order for pickup'."
Keep the brief next to the image in your design file or ticket. When you later debate between two photos, or when a crop cuts off a face, the brief gives you something to check against. The sentence also tells you what to write in the alt text and which part of the frame is the focal point.
Common mistakes
- Choosing by beauty alone. A striking landscape that has nothing to do with the offer wastes the most valuable space on the page.
- Using the photo to repeat the text. If the caption and headline already say it, the photo should add something: proof, scale, emotion, or context.
- Treating every image as a hero. Large photos everywhere dilute attention and slow the page. Reserve big treatments for the images that carry the message.
- Deciding the shape last. Picking a photo before knowing the slot leads to forced crops that cut off the subject.
- Ignoring decorative images in the budget. A decorative photo still downloads. If removing it changes nothing about the page's meaning, consider removing it.
How this connects to the rest of the tutorial
The purpose and slot you decide here feed directly into later steps:
- Selecting photos uses the job and brief to compare candidates.
- Quality, licensing, and consent are checked against how prominently the photo will appear.
- Aspect ratios and crops are set per slot, and the focal point is the part of the photo that carries the job.
- Alt text is written from the job: informative photos get a real description, decorative ones get
alt="".
Exercises
Exercise
A landing page for a language course has the headline "Speak with confidence in 8 weeks" and a sign-up form on the right. List two candidate photos and say which job each does and whether it supports the page message.
Show answer
Sample answer. Photo 1: a learner chatting with a tutor over coffee. Job: persuade and prove, because it shows the outcome (speaking naturally) and supports the confidence message. Photo 2: a generic skyline of a foreign city. Job: set mood only, and it says nothing about speaking or confidence, so it is weaker unless the page needs a sense of place. Photo 1 is the better choice. Any pair is acceptable if each photo is tied to a named job and judged against the headline and the sign-up action.
Exercise
Decide whether each image should have descriptive alt text or alt="". (a) A product photo showing a jacket's waterproof zip. (b) A blurred green gradient photo behind a section heading.
Show answer
(a) Descriptive alt text, for example "Close-up of the jacket's storm flap covering a waterproof zip". The photo informs, and a screen reader user needs the same information. (b) alt="", because the image is decorative and carries no information that the heading does not already give.
Exercise
Write a one-sentence brief for a team photo on an "About us" page, using the template in this chapter. Then name one crop mistake that would break the brief.
Show answer
Sample brief: "This photo should make prospective clients feel that the team is approachable and experienced, in the About page header, so they click 'Book a call'." A crop mistake that breaks it: a tight square crop on mobile that cuts off people at the edges, which makes the team look smaller and less complete than it is.