Large photos are still one of the most common reasons a page feels slow on a phone. A single unoptimized camera file can weigh several megabytes. Visitors on mobile data wait, bounce, and never see the rest of your work. Search engines also treat page speed as part of the experience they measure. This guide explains how to compress images for websites in 2026, which format to choose, and how to check the result before you publish.

Why image size still matters

Screens got sharper, but networks did not become unlimited. A product page with ten full-resolution photos can easily exceed ten megabytes. That delay is not only annoying. It increases bounce rate, hurts Core Web Vitals such as Largest Contentful Paint, and uses data your reader did not agree to spend. Compressing images is not about making pictures look cheap. It is about sending only the detail the screen can show.

A phone camera often saves 4000-pixel-wide files. Your article column may be 800 pixels wide. Serving the original file means the browser downloads extra pixels, then throws them away. Resize first, then compress. Those two steps together usually beat “quality 80” on a huge original.

Laptop and notebook on a desk used for editing website photos in JPEG PNG and WebP
Resize to the width you actually display, then export JPEG or WebP for photos and PNG for sharp logos.

Choose the right format

JPEG for photographs

JPEG remains a reliable choice for photos, screenshots of real scenes, and any image with gradual colour. It uses lossy compression, which means some detail is discarded. For a blog hero or a staff portrait, a well-compressed JPEG is usually indistinguishable from the original at normal viewing size. Avoid JPEG for logos, icons, and screenshots of user interfaces where edges must stay sharp.

PNG for graphics with text

PNG keeps sharp edges and can include transparency. That makes it the default for logos, diagrams, and screenshots of software. PNG files can become large if the graphic has photographic noise. If a PNG of a photo is several megabytes, convert it to JPEG or WebP instead of compressing PNG over and over.

WebP for modern sites

WebP often produces smaller files than JPEG at a similar visual quality. Most current browsers support it. If your audience includes very old devices, keep a JPEG fallback. For a typical 2026 site, WebP is a strong default for photos after you have resized them.

A simple compression workflow

Work from a copy, never from the only original. Photographers and shops should keep the camera file in an archive folder. The web version is a derivative.

  1. Decide the largest width you need on the site. For many blogs that is 1200 pixels. For thumbnails it may be 400.
  2. Resize the copy to that width. Do not upscale a small image.
  3. Compress with a tool that shows the new file size. On Elevators Hub, open the Image Compressor, choose the file, and review the preview.
  4. Compare the preview with the original at the size it will actually appear. Zooming to 400 percent is not how readers see it.
  5. If text looks muddy or skin looks blotchy, raise quality slightly or try WebP instead of a tiny JPEG.
  6. Name the file with words people would search, then add a descriptive alt attribute on the page.

How much should you compress?

There is no single percentage that fits every photo. A dark night scene hides artefacts better than a blue sky. A product photo on a white background shows banding sooner. Start around a moderate quality setting, then only drop further if the file is still heavy and the preview still looks clean.

As a rough target for web articles, aim for under 200 kilobytes for a typical inline photo and under 400 kilobytes for a wide hero, after resizing. Thumbnails should be far smaller. If a decorative background is 2 megabytes, it is not decorative anymore. It is a tax on every visit.

SEO rules for images

Search engines cannot “see” a picture the way a person can. They read the file name, alt text, nearby headings, and page topic. Compression helps SEO indirectly by improving speed. Direct image SEO still needs words.

Descriptive file names

Rename DSC09412.jpg to something like compress-images-for-faster-websites-hero.jpg. Use hyphens, not spaces. Do not stuff ten keywords into the name. One clear phrase is enough.

Alt text that describes the image

Alt text should describe what is in the image for people who cannot see it, and it should be honest. “Illustration of a large photo file shrinking beside a faster web page” is useful. “Best image compressor keyword keyword” is not. If the image is purely decorative, a short alt or an empty alt with a role that marks it decorative can be appropriate. For article figures, always write a real description.

Width and height

Set width and height in HTML so the browser can reserve space and avoid layout jumps. That helps Cumulative Layout Shift. SVG diagrams in this article include width and height for that reason. Raster photos should do the same using the true pixel dimensions of the compressed file.

Lazy loading

Images below the first screen can use loading="lazy" so they do not compete with the main headline image. Keep the hero image eager so it can become Largest Contentful Paint quickly. Add decoding="async" so decoding does not block text.

Common mistakes

People often compress a file that is still 5000 pixels wide. The compressor has to work harder, and the browser still has to decode a huge bitmap. Resize first. Another mistake is running a screenshot of UI through heavy JPEG compression, which makes letters fuzzy. Keep UI shots as PNG or a high-quality WebP. A third mistake is uploading the same huge file to every size on the page. Serve a small thumbnail file for cards and a larger file only on the article itself.

Watermarks and busy overlays also compress poorly. If you must brand a photo, use a simple mark and keep quality a little higher. Never compress a file, then compress the result again and again. Each pass adds artefacts. Go back to the original copy and run one clean export.

Privacy when you compress online

Some websites ask you to upload a photo to a server you do not control. For family pictures, invoices photographed on a desk, or screenshots of dashboards, that is a real risk. Browser-based compressors that process the file on your device avoid that extra copy. Elevators Hub’s image tools are built for that local workflow. You still should not compress highly sensitive documents on a shared computer, and you should close the tab when you finish.

A checklist before you publish

  • The image is resized to the layout width, not the camera width.
  • The format matches the content: photo versus logo.
  • The file size is reasonable on a slow connection.
  • The preview looks acceptable at actual display size.
  • The file name and alt text describe the picture in plain language.
  • Width and height are set, and below-the-fold images are lazy-loaded.

Conclusion

Compressing images is one of the highest-return tasks in web performance. Resize to the size you show, pick JPEG, PNG or WebP for the job, export once from the original, then verify with your eyes at real size. Use a browser compressor when you want a quick, private pass. Combine that with honest alt text and you get a page that loads faster and still makes sense to readers and search engines. Open the Image Compressor on Elevators Hub when you are ready to try the workflow on a file you actually need to publish.