Course contentsShow
← Web Development
Lesson 1255 of 2,98222. Responsive Images and MediaFree lesson

Lazy Loading with Blur-Up Placeholders

Showing low-quality image previews while full images load for better perceived performance.

Lazy Loading with Blur-Up Placeholders

You'll learn how to display a blurred preview image while the full-resolution version loads, creating a smoother perceived loading experience.

What's the Problem?

When you use native lazy loading or custom Intersection Observer approaches, users often see empty white boxes until images load. This can feel jarring and slow, even when your technique is working perfectly. The perception of speed matters as much as actual speed.

The Blur-Up Technique

A blur-up placeholder shows a tiny, heavily compressed version of your image first (often just 20-50 pixels wide), then blurs it with CSS to fill the space. When the full image loads, you smoothly transition from the blurry preview to the sharp version.

Think of it like looking through a frosted window that gradually becomes clear—you see something immediately, which feels much faster than staring at blank space.

How It Works

  1. Embed a tiny inline image (often base64-encoded in your HTML) or load a tiny thumbnail first
  2. Apply CSS filter: blur(20px) to make it look smooth rather than pixelated
  3. Position the full-size image on top (initially hidden)
  4. When the full image loads, fade it in while fading out the placeholder

This works beautifully with both the loading="lazy" attribute and custom Intersection Observer implementations you've already learned. The placeholder appears immediately, then your lazy loading kicks in to fetch the real image only when needed.

Benefits

  • Users see something instantly instead of white boxes
  • Reduces perceived loading time significantly
  • Maintains layout stability (no content shifts)
  • Small data cost (~1-2KB for the tiny preview)

Key Takeaway: Blur-up placeholders improve perceived performance by showing users a preview instantly, making your site feel faster even when actual load times are the same.