Optimise website images by choosing the right dimensions, compressing safely, using descriptive alt text and reserving enough layout space so images do not slow down or destabilise the page.
A faster, cleaner image workflow with smaller files, clearer accessibility text and fewer layout surprises.
Interactive workflow
Work through Image optimisation
Track each step, focus the current task and copy a starter outline for your project notes or implementation plan.
0% complete
Decide the image job
Not every image needs the same treatment. Product images, screenshots, avatars and decoration have different requirements.
Keep informative images sharp enough to inspect.
Avoid uploading huge originals when the rendered size is small.
Use decorative images sparingly and keep them lightweight.
Starter codeCopy and adapt this outline for the workflow.
<section aria-labelledby="optimise-images-for-website-title">
<p>Image optimisation</p>
<h2 id="optimise-images-for-website-title">Optimise Images for a Website</h2>
<p>A faster, cleaner image workflow with smaller files, clearer accessibility text and fewer layout surprises.</p>
<ol>
<li>Decide the image job</li>
<li>Resize and compress before upload</li>
<li>Prevent layout shift</li>
</ol>
</section>
Best practices
Work this way
These are the patterns that keep the workflow practical, accessible and easier to maintain.
Keep informative images sharp enough to inspect.
Resize images near the largest display size needed.
Set width and height or aspect-ratio where practical.
Common mistakes
Avoid these traps
Uploading oversized images and expecting the browser to solve the cost.
Optimising visual effects before checking the biggest page assets.
Lazy-loading content that belongs in the first viewport.
Checklist
Step-by-step workflow
Follow the steps in order, then use the resource sections when you need a tool, reference or UI pattern.
1
Decide the image job
Not every image needs the same treatment. Product images, screenshots, avatars and decoration have different requirements.
Keep informative images sharp enough to inspect.
Avoid uploading huge originals when the rendered size is small.
Use decorative images sparingly and keep them lightweight.
2
Resize and compress before upload
Large images can dominate page weight even when the rest of the site is efficient.
Resize images near the largest display size needed.
Compress while checking visible quality.
Keep originals outside the production asset folder when possible.
3
Prevent layout shift
Images should not push content around after they load.
Set width and height or aspect-ratio where practical.
Use responsive image rules for different viewports.
Avoid lazy-loading images that are needed in the first viewport.
Related resources
Tools, cheatsheets and components
Use these linked DevKitYard sections when the guide moves from planning to doing.