What this image compressor does
Large images slow down web pages, fill up phone storage and bounce off email size limits. This tool reduces the file size of a JPG, PNG or WebP image by re-encoding it at a quality you choose and, if you wish, at smaller pixel dimensions. You see the new file size straight away, compare the result with the original using a slider, and download the file only when you are happy with it. The work is done by your browser, so the image never leaves your device, and it keeps working if your connection drops after the page has loaded.
How to use it
- Drag an image onto the drop area, or select it with the keyboard or the file picker.
- Leave the output format on Same as original, or pick JPEG, WebP or PNG.
- Move the Quality slider. The compressed size updates a moment after you stop moving it.
- Optionally change the width or height, or press a scale preset. With Keep aspect ratio on, the other value follows automatically.
- Check the before-and-after comparison, then press Download compressed image. Use Copy Result to copy the size summary.
How the compression works
The browser decodes your file into pixels, draws them onto an off-screen canvas at the width and height you set, and encodes the canvas again with its built-in image encoder. Three things determine the final size.
Quality (JPEG and WebP)
JPEG and WebP are lossy formats. The quality setting tells the encoder how much fine detail it may discard. Lower values discard more detail and give smaller files. The exact saving depends on the picture: smooth gradients and soft photographs compress more than sharp text or noisy textures.
Pixel dimensions
The number of pixels is width × height, so reducing both dimensions shrinks the file quickly. Halving the width and height leaves a quarter of the pixels. This tool does not enlarge images, because that adds size without adding detail.
Format
PNG is lossless: it does not throw detail away, so the quality slider has no effect on it. A PNG shrinks mainly through smaller dimensions, or by converting to WebP or JPEG. Converting a PNG to JPEG removes transparency, which is why the tool asks for a background colour in that case. If your browser cannot create WebP files, that option is turned off.
Advertisement
Practical examples
Example 1: A phone photo for a website
- A phone photo is 4000 × 3000 px, which is 12 million pixels. A blog column rarely shows it wider than about 1600 px.
- Set the width to 1600 with the aspect ratio locked. The height becomes 1200, so the picture has 1.92 million pixels, about 84% fewer.
- Keep JPEG or WebP at quality 80 and compare. The file is usually far smaller, and the difference is hard to see at normal viewing size.
Example 2: A logo with a transparent background
- Load the PNG. Keep the format as Same as original, or choose WebP.
- Both formats preserve transparency. The comparison area shows a chequered pattern behind transparent parts.
- Avoid JPEG for this file unless you want a solid background colour.
Example 3: When compression does not help
- Upload an image that has already been compressed heavily, then re-encode it at a higher quality.
- The new file can come out larger than the original. The tool reports this as larger and warns you instead of calling it a saving.
- Lower the quality or the dimensions, or keep the original file.
Limitations to know about
- Re-compression loses detail. Lossy compression cannot be undone, so keep your original file.
- Metadata is removed. Canvas re-encoding drops EXIF data such as camera model and GPS position. This helps privacy, but it also removes copyright fields.
- Colour profiles. Embedded colour profiles are not kept. Most images look the same, but wide-gamut or print-oriented files may shift slightly.
- Animation. Only the first frame of an animated WebP or PNG is kept. GIF files are not supported.
- Very large images. Files over 25 MB or 40 megapixels are refused, and some phones may not be able to process very large images.
FAQ
Is my image uploaded to a server?
No. The image is read and re-encoded by your browser using the Canvas API. This page has no upload code, and the only data it sends to analytics is the name of an action such as "download", never your file or its name.
What image quality should I choose?
For photographs, 70 to 85 is a common range that keeps most of the visible detail. Use the comparison slider to check your own image, since screenshots, text and detailed textures may need a higher value.
Why is my compressed PNG not much smaller?
PNG is lossless, so quality settings do not apply. Reduce the width and height, or switch the output to WebP or JPEG, to get a larger reduction.
Will transparency be preserved?
Yes for PNG and WebP output. JPEG does not support transparency, so transparent areas are filled with the background colour you pick, white by default.
Why did the file get bigger?
If the original was already compressed efficiently, re-encoding it at a high quality or in a less efficient format can increase its size. The tool says so plainly. Lower the quality or dimensions, or keep the original.
Can I compress several images at once?
Not yet. This tool handles one image at a time. If you select several files, only the first is used.
Does it work on a phone?
Yes. Tap the drop area to choose a photo from your gallery. Very large photos may be limited by your phone's memory, in which case reduce the dimensions.
More tools
Browse all Tools & Calculators on Hira Science Academy.