Skip to main content

How to Optimize Images for Website Speed

Step-by-step: optimize images for website speed with presets, correct dimensions, lazy loading, and copy-paste HTML tags.

CompressMyPic Editorial Team · Published Nov 17, 2026 · 10 min read

How to Optimize Images for Website Speed

Images are the heaviest part of most websites. A page that loads slowly usually has images to blame, and fixing them is the fastest speed win available.

This guide walks through the whole optimisation process. You will audit the page, pick the right preset, optimise the images, and paste the HTML into place.

It works for blogs, shops, and business sites, and you need no coding experience beyond copying and pasting.

Step 1: Audit the Page First

Before optimising anything, find out which images are the problem. Open the page and note which images look slow to appear.

Use a free speed tool to measure the page. It lists the heaviest images and shows how much each one costs in loading time.

Note the total image weight of the page. A page with 5MB of images has an obvious problem, while a page with 500KB is already in good shape.

Write down the worst three images. Fixing those first gives the biggest speed gain for the least effort.

Step 2: Open the Web Image Optimizer

Open the Web Image Optimizer in your browser. No account or install is needed.

The tool runs entirely on your device. Your images are processed locally and never uploaded to a server.

If you are optimising a whole site, work in batches. Thirty images at a time is a comfortable batch size for most browsers.

Bookmark the page. Image optimisation is a recurring job, and the tool is one you will return to often.

Step 3: Pick the Right Preset

Choose the preset that matches where the image will appear. A hero image, a product shot, and a thumbnail each have their own preset.

The E-Commerce Product preset is the default. It caps images at 1200 pixels wide in WebP at 82 percent quality, which suits most product photos.

For a blog feature image, use the hero or card preset depending on the layout. Match the preset to the display size, not to the file size.

For social sharing images, use the Social OG preset. It switches the format to JPG automatically, since social platforms prefer it.

Step 4: Upload the Images

Drag the images onto the upload area or tap to browse. JPG, PNG, WebP, and HEIC files are accepted.

Upload the highest-quality originals you have. A 12-megapixel original gives the optimiser far more to work with than a small copy.

For a batch, add all the images for one page at once. They share the preset, which keeps the results consistent.

Wait for the upload to finish before changing settings. The tool needs the full files before it can optimise them.

Step 5: Customise the Settings

After picking a preset, adjust the settings if the slot demands it. Change the dimensions, the format, or the quality to suit the design.

Keep the dimensions close to the display size. An image shown at 800 pixels wide does not need to be 2400 pixels in the file.

Turn on Only downscale when the batch mixes large and small images. It protects icons and thumbnails from being stretched larger.

Move the quality slider only when needed. Most presets sit between 75 and 85 percent, which is the right range for nearly every image.

Step 6: Preview the Results

Preview each optimised image at full size before downloading. A small thumbnail hides problems that are obvious at full size.

Check fine detail first. Fabric texture, text, and edges are the first things to soften under compression.

Compare a few results with their originals. Small differences are normal; unreadable text or blotchy skin is not.

Check the file sizes too. The summary shows how much each image shrank and the total saving across the batch.

Step 7: Copy the HTML Tag

Click Copy Image Tag for each image. The tag includes the source, dimensions, alt text, and loading behaviour, ready to paste.

Check the alt text in the tag. Edit it if the generated text does not describe the image well.

Confirm the loading attribute is right. Heroes should load immediately, while below-fold images should lazy-load.

Paste the tag into your page where the image belongs. Replace the old image tag completely, rather than editing it by hand.

Step 8: Upload and Test the Page

Upload the optimised images to your site. Use the same filenames the tool produced, so the HTML tags match the files.

Open the page in a fresh browser tab. Check that every image appears and that nothing looks stretched or blurry.

Run the speed tool again and compare the numbers. The total image weight should have dropped sharply, and the load time with it.

Test on a phone as well as a laptop. Most visitors browse on mobile, and the page must feel fast there first.

Fixing Common Problems

If an image looks blurry, the source may have been too small. Re-optimise from a larger original with the same preset.

If the page still loads slowly, check for unoptimised images. A single forgotten 5MB banner can undo the whole batch.

If images appear stretched, the dimensions in the tag do not match the file. Re-copy the tag from the tool rather than editing it by hand.

If a social share shows no image, check the format. Social platforms prefer JPG, and the Social OG preset handles that automatically.

Workflow: A Blog Post

Gather the images for the post and upload them as one batch. Use the card preset for thumbnails and the hero preset for the feature image.

Preview the feature image carefully. It is the largest image on the page and the one readers judge first.

Copy the HTML tags and paste them into the post. Check the alt text on each one before publishing.

Publish the post and test it on a phone. The images should load quickly and look sharp as you scroll.

Workflow: A Product Page

Collect the product shots and upload them as one batch. Use the E-Commerce Product preset for consistent results.

Preview the most detailed products first. Fabric texture and printed labels are the first things to soften.

Copy the HTML tags and paste them into the product page. Confirm the loading attribute is correct for each image position.

Check the product page on a phone after uploading. Most shoppers browse on mobile, and the images must look good there.

Using Free Speed Tools Well

Free speed tools measure your page and list the problems. They are the best starting point for any optimisation job.

Run the tool on the live page, not on a local copy. The live page includes the hosting, the CDN, and the real-world conditions your visitors face.

Read the image recommendations first. They name the exact files that cost the most time, which tells you where to start.

Ignore the perfect score. A score in the green range is good enough; chasing 100 wastes time better spent on content.

Re-run the tool after each round of fixes. The changing numbers show whether your work is paying off.

Choosing Sizes by Page Slot

Every slot on a page has a natural image size. Matching the file to the slot is the core skill of web optimisation.

Hero images need the largest files, often 1200 to 1600 pixels wide. They fill the screen, so they must stay sharp.

Feature images in blog posts suit 800 to 1200 pixels. They are large but not full-screen, so a middle size works.

Thumbnails and avatars need only 200 to 400 pixels. Anything larger wastes bandwidth on detail nobody can see.

Measure the slot in your theme before choosing. The displayed width decides the file width, and guessing wrong wastes kilobytes.

Responsive Images in Practice

Responsive images serve different files to different screens. A phone gets a small file, while a desktop gets a larger one.

The srcset attribute lists the available sizes, and the browser picks the right one for the screen it runs on.

Generate two or three sizes per image. A mobile size, a tablet size, and a desktop size cover nearly every visitor.

Test on a real phone after adding responsive images. The loading improvement on mobile is often dramatic.

Keep the HTML simple. A srcset with three sizes is plenty; ten sizes add complexity without visible benefit.

Image SEO While You Optimise

Optimisation and SEO go together. A fast page with well-described images ranks better than a slow page with anonymous files.

Use descriptive filenames. A name like blue-cotton-shirt.jpg tells search engines what the image shows.

Write real alt text for every image. Describe the content in a sentence, and include the key detail a searcher would look for.

Do not stuff keywords into filenames or alt text. A natural description helps readers and search engines alike.

Submit an image sitemap if your site relies on image search. It helps search engines discover images they might otherwise miss.

Maintaining Optimised Images Over Time

Optimisation is not a one-time job. New images arrive every week, and each one needs the same treatment as the last.

Build optimisation into the publishing checklist. Every post should pass through the optimiser before it goes live.

Audit the site quarterly. Old images from before the optimisation habit are often still heavy, and a batch fixes them quickly.

Watch for theme changes. A new theme may display images larger than the old one, which means the old files are suddenly too small.

Keep the originals safe. When the design changes, the originals let you re-optimise to the new sizes without quality loss.

Optimisation Standards for Teams

Teams that publish together need a shared standard. Agree on the preset, the naming pattern, and the size budget before the first post.

Write the standard down in one page. A short guide in the team wiki prevents a hundred small questions.

Assign one person to check image weight on each publish. A second pair of eyes catches the heavy image that the author missed.

Review the standard when the design changes. Presets that suited last year's theme may not suit this year's layout.

Good standards make speed routine. The team stops thinking about optimisation because the process handles it automatically.

Speed Myths Worth Ignoring

One myth says only the homepage matters for speed. In reality, visitors land on blog posts and product pages, and those must be fast too.

Another myth says a fast host fixes slow images. Hosting helps, but a 5MB image is slow on any host, and optimisation is the only fix.

A third myth says WebP alone solves everything. Format helps, but dimensions and lazy loading matter just as much as the format choice.

The truth is boring and practical: right size, right format, lazy load below the fold, and dimensions in every tag. Do those four things and the page will be fast.

Test your own pages to settle the question. The speed numbers do not care about myths, and they will tell you what actually works.

A Final Check Before You Publish

Run the speed tool one last time after all images are optimised. Confirm the total image weight dropped and the load time improved.

Load the page on a real phone over a mobile connection. The numbers in a lab test are useful, but the feeling on a phone is the truth.

Check every image visually once more. A fast page with a blurry hero is not a success, and a careful preview catches it.

Keep Learning From Each Page

Every page you optimise teaches something. Note which preset worked, which image was hardest, and what the speed numbers did, because those lessons compound with every page you fix and every site you improve.

Those notes become your playbook. The next page takes less time because the last page already answered the questions.

For the full guide to the optimiser, read Web Image Optimizer: Complete Guide. For the Core Web Vitals deep dive, see Image Optimization for Core Web Vitals: LCP and File Size. For simple size targets, the 200KB compressor covers most web images.

Frequently asked questions

How much faster will my site be after optimizing images?

It depends on how heavy the images were. A page with 5MB of images that drops to 500KB can load several seconds faster, especially on mobile. Run a speed test before and after to see the exact improvement for your page.

Should I optimize images before or after uploading them to my site?

Before. Optimizing first gives you control over dimensions, format, and quality, plus the ready-made HTML tag. Uploading first and relying on the platform to compress them usually produces worse results.

Can I optimize thirty blog images in one batch?

Yes. Add all thirty images, pick a preset, and download them together. Preview a few results before downloading the whole batch, and keep the preset consistent so the images look uniform on the site.

Why is my hero image still slow after optimization?

Check that lazy loading is off for the hero, since delaying it hurts loading speed. Also confirm the hero dimensions match the display size; an oversized hero wastes bandwidth. Preloading the hero can help further.

Do I need to update the HTML when I replace an image?

Yes, if the dimensions or filename changed. The HTML tag carries the width, height, and source, so an outdated tag can stretch the image or break the layout. Copy a fresh tag from the tool whenever you replace an image.

What image size should I use for a blog feature image?

Match the display size of your theme, usually 1200 pixels wide or less. The hero or card preset handles this automatically. Serving an image twice as wide as it displays wastes bandwidth without visible benefit.

Related guides

Compress

How to Compress a GIF

Step-by-step: compress any animated GIF for Discord, Slack, websites, and chat. Presets, palette, scale, and fixes for stubborn files.

Nov 17, 2026 · 10 min readRead the guide →

Share this guide

← Back to the blog