---
title: "Tech Tip #25: Load images only when they're needed"
description: "Most of your images load before anyone scrolls to them."
url: https://greencode.ai/tech-tips/25-lazy-load-offscreen-images/
---

# Tech Tip #25: Load images only when they're needed

**Most of your images load before anyone scrolls to them.**

[Watch the video](https://media.greencode.ai/shorts/lazy-load-offscreen-images-b24da33120ca.mp4)

Video created by [explainapaper.com](https://explainapaper.com/?utm_source=greencode.ai&utm_medium=film&utm_campaign=made-by)

### The problem

Pages fetch every image up front, including ones far below the fold that many visitors never see.

### The fix you can use today

- Add loading="lazy" to images and iframes below the fold.
- Give images width and height so the layout doesn't jump.
- Keep the first-screen hero image eager.

The Green Software Foundation suggests loading images only when they come into view. GreenCode's own website does this.

### Tools that help

- [Lighthouse](https://developer.chrome.com/docs/lighthouse/overview?utm_source=greencode.ai&utm_medium=referral&utm_campaign=greencode): audits a page for total byte weight, unused JavaScript and CSS, image formats and offscreen images
- [Green Software Patterns catalogue](https://patterns.greensoftware.foundation/catalog/?utm_source=greencode.ai&utm_medium=referral&utm_campaign=greencode) (Green Software Foundation): cloud, web and AI patterns for reducing carbon, each reviewed by practitioners

### How GreenCode helps

GreenCode helps tackle this by practising it on greencode.ai: WebP images, scripts only where they are used, purged styles and one self-hosted font. That cut a first view of the home page from 6,766 KB over 80 requests to 1,719 KB over 33. [More on this](https://greencode.ai/green-hosting/).

### Tags

#web-performance#images#frontend

### Sources

- [GreenCode State of the Art Review, D2.1 (2025), PDF p. 21: GSF pattern Defer Offscreen Images saves bandwidth and computing power on server and client](https://greencode.ai/publications/d2-1-state-of-the-art-review/)
- [Green hosting: native lazy loading on greencode.ai](https://greencode.ai/green-hosting/)
- [Green Software Foundation, Green Software Patterns: Defer offscreen images](https://github.com/Green-Software-Foundation/patterns/blob/main/docs/development/media-and-code-efficiency/defer-offscreen-images.md?utm_source=greencode.ai&utm_medium=referral&utm_campaign=greencode)
- [W3C, Web Sustainability Guidelines: lazy and deferred loading of media](https://www.w3.org/TR/web-sustainability-guidelines/#lazy-loading)

[All GreenCode Tech Tips](https://greencode.ai/tech-tips/)

#### Key Facts

- Tip **#25**
- For **Developers**
- Category **Web and front-end**
- Format **short video**
![GreenCode](https://greencode.ai/wp-content/uploads/2024/12/greencode-logo-website-small-colours-2.webp)

Want this checked on your own system? Talk to the GreenCode team.

[Get in touch](https://greencode.ai/contact/)
