Why you should optimise images before upload

Originally published: 31 December 2023

Save big on bandwidth by optimising images before you deploy your web app

optimising images

Optimizing Images Before Upload for Maximum Performance

When adding images to your site, it’s tempting to simply throw them into an image CDN or optimizer as-is. But taking a few minutes to optimize your images beforehand can make a dramatic difference in site performance, cost savings, and overall efficiency.

The Problem With Unoptimized Images

What happens when you upload uncompressed, unoptimized images to a service like Cloudinary or Vercel’s Image Optimizer?

A few issues arise:

For example, here’s a nice hero image I might use on my site:

Unoptimized Hero Image

At 4MB and 4829x3198 pixels, this uncompressed PNG is much heavier than needed for a web hero image.

Uploading images like this has consequences:

Optimizing images ourselves before upload avoids these pitfalls.

Optimizing For The Web

Before uploading any image, we should:

Here’s how I might optimize the hero image for web use:

This produces an optimized hero image:

Optimized hero image

The file size is now just 107KB, 5% the size of the unoptimized original.

By doing this optimization manually, I get huge performance benefits:

Just a little effort upfront to optimize brings big speed and cost rewards!

Optimizing For Each Use Case

To really maximize gains, we can tailor optimization to each image’s specific use case on the page:

Dialing in the best settings for each image purpose gives us site performance perfected.

Yes, image CDNs will do optimization automatically. But by handling it ourselves first, we save bandwidth and deployment time while delivering the fastest experience to our users. That’s why optimizing your own images is worth the small extra effort.

Read Count: 0


⬅️ Previous Post

Understanding creative commons: a guide to open licensing

Next Post ➡️

Building a React/NextJS boilerplate with MDX support