Compressing Images for a Website: What to Choose and How Not to Spoil Quality
Three levers that reduce image weight: size, format and quality. How to choose a compression level, when a palette works for PNG and why the “do not enlarge the file” rule matters.

Images are usually the heaviest part of a page, so they are what most often slows a site down. The good news: image weight can be cut sharply with almost no loss of quality. Here is the order of actions.
Three levers
The weight of an image depends on three things: size in pixels, format and quality. Work in this order.
1. Size in pixels
A phone photo can be 4000 pixels wide, while the page shows it in a block 800 wide. The browser downloads the whole file but displays only part of it. Reduce the image to the needed dimensions: for ordinary screens the real size is enough, and for high pixel density screens twice that.
2. Format
- JPG suits photos.
- WebP usually gives a smaller file at a similar look and is supported by modern browsers.
- PNG is needed for graphics with transparency or crisp edges: logos, icons, screenshots.
Read more about choosing a format in Image Formats: JPG, PNG, WebP or GIF.
3. Quality
For JPG and WebP values of 75–85 work well: the weight drops substantially and the difference to the eye is small. For important images compare the result with the original and find your own threshold.
PNG and the palette
PNG keeps all the colors, so photos in it are heavy. But for logos and screenshots a palette of up to 256 colors is enough: the file shrinks severalfold and the difference is barely visible. It matters that the tool keeps transparent edges and shadows and that brand colors stay exact. For photographs a palette does not fit: choose JPG or WebP.
The “do not enlarge” rule
Sometimes an image is already optimized, and re-encoding gives a file that is not smaller, or even bigger. Then the right thing is to keep the original. A good tool does exactly that and says so plainly.
How this affects search
Heavy images slow down the display of the main page element, which is one of the Core Web Vitals metrics. We wrote about it separately: Core Web Vitals in plain words. Image optimization is one of the simplest and most effective actions for speed.
Privacy
Many online services upload your images to a server. Photos can contain metadata, including coordinates. It is safer to choose a tool that works in the browser and sends nothing.
Try it
We built a free image compression tool: three levels, resizing, WebP, a palette for PNG and batch processing with ZIP. Everything in your browser. If what you need is a format change, use the image converter. Read how we tested compression in the case study, and for optimizing a whole site see the web development service.
How we help with this
Services related to the topic of this article:
Frequently asked questions
Where should image optimization start?
With the size in pixels: an image should be no wider than it is displayed on the page (with some reserve for high pixel density screens). This usually gives the biggest gain.
Does compression always worsen quality?
JPG and WebP are compressed with loss, but at moderate levels the difference is barely visible. A palette PNG also loses colors, so it suits graphics, not photos.
Read next
Web developmentImage Formats: JPG, PNG, WebP or GIF? What to Choose and How to Cut File Size
When each format fits, how to change size and quality without losing looks, and why the right images make a site faster.Read →
Web developmentCore Web Vitals in Plain Words: What Google Measures and How to Speed Up Your Site
Three metrics Google uses to judge page experience: what LCP, INP and CLS mean, which values count as good and what to fix first.Read →
Web developmentNext.js or WordPress: What to Choose for a Company Website
An honest comparison of two approaches to a corporate website: speed, flexibility, maintenance cost and security. When WordPress is enough and when Next.js is worth it.Read →
Need advice on the topic?
Describe the task: we will suggest where to start and say honestly what you can skip.