Skip to content
Insights

Lighter websites

A Simple Image Routine for Anyone Who Edits Pages

A short routine for anyone adding photos to posts and pages: resize first, pick the file type, name it, write alt text and captions, clear old uploads.

Sol Rudd6 min read

Diagram: three steps for adding a photo, shown as cards: resize a large photo to a smaller frame, give the file a plain descriptive name, and describe it with short alt text

Many heavy images don't arrive during a redesign. They arrive one blog post at a time, uploaded by whoever is writing that week, straight from a phone or a stock library. This article is for those people: the owner, the office manager, the volunteer who updates the news page. It is a routine you can follow every time you add a picture, without needing to know any code. For the technical side, such as responsive images and lazy loading, see image weight: the quickest win.

Resize before you upload

A photo is measured in pixels as well as in kilobytes, and the two go together: a wider photo usually means a bigger file. Lighthouse, the checker inside Chrome and PageSpeed Insights, puts the ideal plainly. In its guide to properly sized images it says a page “should never serve images that are larger than” the version shown on screen.

  • Ask your web person for one number: the widest an image ever appears in your theme, allowing for sharp high-density screens. Write it on a sticky note. Resize every photo to that width before uploading.
  • Use a simple tool. The Lighthouse guide to efficiently encoding images suggests ImageOptim or Squoosh for small sites, and notes that WordPress and other platforms have plugins that compress uploads.
  • Don't rely on your platform alone. WordPress makes several smaller copies of each upload and adds them to the page automatically, as web.dev's CMS chapter explains. Since version 5.3 it also scales down originals wider or taller than 2,560 pixels by default. That still leaves large files, and choosing “Full Size” in the editor sends the biggest one. Lighthouse advises avoiding Full Size unless the dimensions suit where the image is used.

To give a sense of scale: if a 4 MB photo goes in at the top of a page and resizing brings it down to 300 kB, that page loses 3.7 MB. Under the Sustainable Web Design Model v4, which GreenTracer uses, that lowers the estimate by about 0.55 g CO₂e per page view (about 0.45 g on a host listed as green). Those figures are illustrative arithmetic, not a measurement of your site.

Choose the file type

You don't need to memorise formats. A two-question habit covers most uploads: is it a photograph, or is it a logo, diagram or screenshot with flat colours and text? Photos suit JPEG, WebP or AVIF; flat graphics suit PNG or SVG. If your platform converts uploads to a modern format, let it. Our guide to image formats explains each one and what browsers support. One rule of thumb worth keeping: never upload a photograph as a PNG just because that is how the screenshot tool saved it.

Give the file a sensible name

IMG_4821.jpg tells nobody anything. Rename the file before you upload it, in a few plain words that say what it shows, for example bakery-counter-morning.jpg. Google's image guidance says file names give it “very light clues” about the subject, and advises against generic names such as image1.jpg. There is a practical reason too: MDN notes that when an image has no alt attribute, some screen readers may read out the file name instead. A good name also makes the media library far easier to search, which helps with the tidy-up below.

Write alt text for the reader

Alt text is the short description read aloud by screen readers and shown if the image fails to load. The W3C Web Accessibility Initiative's alt text decision tree is the best quick reference. In practice, ask why the image is there:

  • It shows something the reader needs. Describe what it means in this context, briefly. W3C's informative images guidance says the text should convey the meaning or content shown, and that a short phrase is usually enough. A stock photo of smiling customers might really be saying “We're family-friendly”.
  • It is a link or a button. Say where it goes or what it does, not what it looks like.
  • It contains words. If those words aren't already on the page, put them in the alt text.
  • It is pure decoration. Leave the alt text empty. W3C's decorative images page says an empty alt lets assistive technology ignore the image, while leaving the attribute out altogether is not an option. Most editors have an alt field; leaving it blank usually produces the empty version, but ask your web person to confirm.

Captions are for everyone

A caption is visible text under the image, seen by all readers. On the page it is usually a <figcaption>, which MDN describes as a caption or legend for its figure. It does not replace alt text: MDN's own example uses both. Use the caption for what every reader benefits from, such as who is pictured, where, or a photo credit. Use the alt text for what someone who can't see the image would miss. If the caption already says everything the image shows, W3C's guidance on images described by nearby text suggests the alt text need not repeat it. Google also says it reads captions to understand what an image is about.

Clear out what you no longer use

Media libraries fill up with drafts, duplicates and the original 6 MB version of a photo you later resized. An upload that no page uses isn't downloaded by visitors, so deleting it won't change a page's carbon result. The value of a tidy-up is different: it stops someone picking the heavy original next time, and it keeps the library searchable. Before deleting, check the file isn't linked from old posts, emails or social posts. A few times a year, also look for heavy images already in use and replace them with resized copies; that is the part that does change your result.

A routine to pin up next to your desk:

  1. Resize to your agreed width and compress.
  2. Photo or graphic? Pick the file type.
  3. Rename the file in plain words.
  4. Write alt text for its purpose, or leave it empty if decorative.
  5. Add a caption if every reader would benefit.
  6. After publishing, check the page and keep the report; it keeps earlier checks as history when you check again.

Sources

All articles

Check your own site

See the estimated carbon of one page view on your page, its grade, and whether your host is listed as green. It's free.

Check a website