Website images often create a performance problem before a visitor notices anything is wrong. This workflow explains how to choose an image format, create responsive sizes, compress files without obvious quality loss, write useful filenames and alt text, and maintain a repeatable review cycle for hero images, thumbnails, logos, and social previews.
Overview
Image optimization is not the same as making every file as small as possible. The practical goal is to deliver an image that is large enough for its display context, clear enough for the intended use, and encoded in a format that suits its visual content. An oversized image wastes bandwidth and can delay the visible page. An image that is too small or compressed too aggressively may look soft, blocky, or unreadable.
A reliable workflow has four parts:
- Choose the right source dimensions and aspect ratio.
- Select a format based on whether the image contains photographs, transparency, text, or simple graphics.
- Export several responsive sizes and compress them at an appropriate quality level.
- Review loading behavior, accessibility, and the result on real pages.
Keep original, high-quality source files separately from web-ready derivatives. This lets you create new sizes or formats later without repeatedly re-compressing an already compressed file.
What to track
Format choice
The best image format for a website depends on the image rather than on a single universal rule. Use this comparison as a starting point, then test the exported result in its actual layout.
| Format | Usually suitable for | Strengths | Watch for |
|---|---|---|---|
| JPEG | Photographs and complex images without required transparency | Widely supported and often efficient for photographic content | Repeated editing can reduce quality; sharp text and flat graphics may show artifacts |
| PNG | Logos, interface graphics, screenshots, and images needing transparency | Lossless export and dependable transparency support | Can produce large files, especially for photographs |
| WebP | General-purpose photographs, graphics, and transparent assets | Supports lossy and lossless compression with broad practical use | Confirm that the chosen CMS, image pipeline, and older target environments handle it as expected |
| AVIF | Photographs and graphics where strong compression is valuable | Can produce compact files at good visual quality | Encoding time, editing workflow, and browser or platform support should be checked for your audience |
For a modern deployment, WebP or AVIF may be useful delivery formats, while JPEG or PNG can remain valuable as source or fallback assets. Do not convert a logo with transparent edges into a format that removes transparency, and do not use a highly compressed photographic format for small text that must remain crisp.
Dimensions and responsive sizes
Start with the largest display size the page genuinely needs, not the largest file your camera or design tool produced. A full-width hero image may need a larger derivative than a card thumbnail, but both should be generated from the same source. The exact dimensions depend on the site layout, display density, crop behavior, and CMS limits.
- Record the intended display width for each image role: hero, banner, card, avatar, logo, and inline content.
- Create at least a small, medium, and large derivative when the image appears in layouts with materially different widths.
- Preserve the subject’s focal point when creating crops for mobile or card layouts.
- Use the HTML
srcsetandsizesattributes, or the equivalent feature in your site builder, when multiple widths are available. - Check that the browser is not downloading a desktop-sized image for a small mobile slot.
Responsive images are most useful when the variants reflect real layout breakpoints. Producing dozens of nearly identical files adds library complexity without necessarily improving delivery.
Compression and quality
Compression settings should be evaluated visually, not chosen by a number alone. Export a test group that includes a face, sky or gradient, fine texture, dark area, transparent edge, and any small text. Inspect the result at its rendered size and at a larger zoom. Look for ringing around text, muddy shadows, banding in gradients, halos around transparent objects, and details that have disappeared.
For photographic images, a moderate lossy setting is often a sensible first test. For logos, diagrams, screenshots, and assets with sharp edges, use a format and setting that preserve those edges. Remove metadata that is not needed for the web when your export tool permits it, but retain information required by your workflow or legal and accessibility processes.
Names, alt text, and context
Use descriptive, stable filenames such as artisan-coffee-shop-front.webp rather than IMG_4832.jpg. Keep names lowercase, use hyphens between words, and avoid stuffing filenames with repeated keywords. A filename helps maintain a media library, but it does not replace alt text.
Write alt text based on the image’s function. A product image may need the product name and relevant distinguishing detail. A decorative flourish should generally have empty alt text when the implementation supports it. If an image contains important words, provide that information in accessible text rather than relying only on the pixels. Check the result with keyboard navigation and a screen reader when the image conveys essential meaning.
Cadence and checkpoints
Use a small checklist each time you publish a page or campaign:
- Before upload: Remove unnecessary source dimensions, choose the image role, crop intentionally, and export a web-ready file.
- During upload: Confirm the CMS or site builder has not rejected the format, resized the file unexpectedly, or created a duplicate that is larger than the original.
- Before publishing: Inspect the image on a narrow viewport, a wide viewport, and a high-density display when available. Confirm the crop, sharpness, and loading behavior.
- After publishing: Check a performance report or browser audit for oversized images, missing dimensions, inefficient delivery, and images that are loaded before they are needed.
- Monthly or quarterly: Review the largest media files, unused derivatives, duplicate uploads, and image-heavy templates. Record recurring problem patterns rather than fixing only one URL.
For a site deployed through cloud hosting, image delivery is only one part of performance. Also review caching, content delivery configuration, lazy-loading behavior, and whether your deployment pipeline creates optimized derivatives consistently. Keep image cleanup and backup procedures coordinated; see the website backup and restore testing guide before deleting media that may be needed for recovery.
How to interpret changes
If a performance report identifies an oversized image, first compare its intrinsic dimensions with the space in which it is displayed. If the file is several times wider than the rendered slot, create a smaller derivative or correct the responsive image configuration. If the dimensions are reasonable but the file is still heavy, test another format or compression setting.
A sudden increase in image weight often points to a workflow change: a new CMS plugin, a switched site builder, a theme update, an export preset, or a campaign team uploading camera originals. Compare a recently published file with an older equivalent and check whether the server is delivering the intended format. A format conversion that saves bytes but causes visible artifacts is not a successful optimization; adjust the quality or choose a different format.
If images look blurry, do not immediately increase compression quality. Check whether the browser selected a smaller srcset candidate, whether CSS is enlarging a thumbnail, whether the crop was created at the wrong aspect ratio, or whether a cached old derivative is being served. If a page feels slow despite small image files, investigate other resources as well, including scripts, fonts, server response time, and render-blocking assets.
When to revisit
Revisit this workflow whenever you launch a new page type, change website builders, replace a media plugin, migrate hosting, or introduce a new image-processing pipeline. It is also worth checking after a major browser or platform change, because format support and CMS capabilities can evolve. Treat browser support as an item to verify for your audience rather than as a permanent assumption.
Set a monthly or quarterly media review for active sites. Start with the pages that receive the most traffic, the templates used for landing pages and product listings, and the URLs highlighted by performance monitoring. Keep a short log containing the date, affected URL, image role, original dimensions, delivered format, file size, and the change made. This makes recurring regressions easier to identify.
For your next publication, use this order: identify the display role, create the required responsive sizes, choose a suitable format, compress a representative sample, add meaningful alt text, test the rendered page, and record the result. If the change affects deployment behavior or causes a regression, use your website deployment rollback plan rather than leaving a known performance problem in production. Image optimization works best as a repeatable publishing habit, not as a one-time cleanup.