Image Compressor & Resizer

Compress and resize JPG, PNG and WebP images

Compress and resize JPG, PNG and WebP images

Drop an image here

or click to choose a file · JPG, PNG, WebP, AVIF

About Image Compressor & Resizer

This compressor does not download a codec. It re-saves your image through the encoder built into your browser (canvas.toBlob), so results vary slightly between browsers, and AVIF may appear in the format list in Chrome but vanish in another browser. If a page asks canvas for a format it cannot encode, the browser quietly falls back to PNG, which usually makes the file bigger — so the tool tests support once on load and hides formats that would fail that way.

When you drop a file, the tool shrinks a copy to 220px and counts two things: whether any pixel is transparent, and how varied the colours are. The default recommendation is WebP. If the image looks like a flat graphic (fewer than 3% distinct colours in the sample, and not a JPEG to begin with), it skips the quality search and uses a fixed 92. Photos are actually encoded at 35, 45, 55, 65, 75, 85 and 95, and the tool picks the knee of the resulting size curve — the point where going lower saves little and going higher costs a lot.

Photos and screenshots want different quality settings

Photographs are full of sensor noise and fine texture, which hides the high-frequency detail that JPEG and WebP throw away. For on-screen use, most people cannot tell WebP 70–80 or JPEG 75–85 apart from the original, and the tool's starting values (WebP 80, JPEG 82, AVIF 55) sit in that range. AVIF delivers more quality per number, so a 55 in AVIF is not comparable to a 55 in JPEG.

Screenshots, spreadsheets and code captures behave the opposite way. Around a hard edge — black text on white — lossy codecs produce faint halos known as ringing. For these, keep quality at 90 or above, or leave the file as PNG if size is not the real problem.

Why a PNG screenshot barely shrinks as JPEG

PNG runs each row through a filter that stores differences from neighbouring pixels (the spec defines five: None, Sub, Up, Average and Paeth) and then compresses the result with deflate. A screenshot with large flat areas turns into long runs of zeros, which deflate squeezes extremely well. JPEG works on 8×8 blocks of frequency coefficients and gains less from flat colour; once you raise the quality to keep text crisp, the JPEG can end up larger than the PNG you started with.

The reverse is also true: a photo saved as PNG has almost no repetition for the filters to exploit and is often several times larger than a JPEG of the same image. That is why the tool never recommends PNG automatically. You can still pick it manually, and the quality slider is disabled when you do, because PNG has no quality setting.

Red text smears because of chroma subsampling

JPEG and lossy WebP store brightness separately from colour, and commonly keep colour at half the resolution in each direction (4:2:0), because our eyes resolve colour detail less sharply than brightness. In a photo you will not notice. On thin red lettering or a fine blue line over white, colour bleeds into neighbouring pixels and the edges turn muddy.

Browser encoders expose no subsampling option, so this tool cannot turn it off. For a banner or chart with lots of coloured text, raising quality helps only partly. Keeping PNG, or exporting from an editor that lets you choose 4:4:4, is the practical fix.

Resolution is the biggest lever

File size tracks pixel count far more than it tracks the quality number. Taking a 4000×3000 photo down to 2000 pixels wide removes three quarters of the pixels. That usually saves more than dropping quality from 85 to 60, and the smaller image looks sharper on screen because it has no visible artefacts. For blogs, email and chat, try a max size of 1600–2560 with high quality before you touch the slider.

The max size field caps the longer side and keeps the aspect ratio. It never enlarges an image beyond its original dimensions.

What happens to rotation and metadata

Phones often store pixels sideways and add an EXIF flag saying “rotate 90° when displaying”. Current browsers honour that flag when drawing images (the CSS image-orientation property defaults to from-image), so the canvas output bakes in the orientation you see, and the flag is no longer needed.

EXIF data — capture date, camera model, GPS coordinates — and embedded colour profiles are not copied to the output. That is handy if you want to strip your location before posting a photo, but keep the original if your photo library sorts by capture date. When the original contains EXIF, the tool shows a note that it will be dropped. If it carries a color profile other than sRGB, such as the Display P3 profile in iPhone photos, the tool also warns that the profile is removed and the image converted to sRGB, so very vivid reds and greens may shift slightly.

Resize mode: when you need exact pixels

The Resize tab skips the compression recommendation and simply redraws the image at the size you ask for. There are three ways to specify it. Pixels lets you type a width or height; with the aspect lock on, entering one fills in the other. Turn the lock off and enter a different ratio, such as 1080×1080 for a 4:3 photo, and the image is stretched or squashed to fit rather than cropped — faces come out long. Percentage uses a slider from 1 to 1000%. Fit to max size shrinks the longer side to the limit (1920 by default) and never enlarges.

Going above 100% in percentage mode enlarges the picture but cannot invent detail; you just get more pixels and a bigger file. At the other extreme, a large reduction — 4000 px down to 300 px, say — is not done in one jump: the tool halves the image step by step (2000 → 1000 → 500 → 300 px) with high-quality interpolation, which keeps fine lines and tight patterns from turning into jaggies or moiré. Output can be JPEG, PNG or WebP, and the file name gets name-WIDTHxHEIGHT appended. A transparent PNG saved as JPEG gets its transparent areas filled with white.

Worked examples

A 12-megapixel phone photo for a blog post

Input
4000×3000 JPEG, about 4 MB; max size 2000; WebP at quality 80
Output
12,000,000 pixels → 3,000,000 pixels (one quarter)

Resizing alone removes 75% of the pixels before WebP encoding adds its own savings. The final byte count depends on the photo, so read the savings figure the tool reports.

Transparent logo PNG

Input
512×512 PNG with a transparent background and only a few colours
Output
Recommends WebP at a fixed quality of 92

Fewer than 3% distinct colours marks it as a flat graphic. WebP keeps the alpha channel, so the background stays transparent. If you force JPEG instead, the transparent area turns black.

Resize: 1080 px wide for social media

Input
4032×3024 photo, Pixels mode, width 1080, aspect locked
Output
1080×810, saved as photo-1080x810.jpg

Height is 1080 × 3024 ÷ 4032 = 810. The same photo at 25% in percentage mode becomes 1008×756.

How to use it

  1. Drop an image (JPEG, PNG, WebP or AVIF, up to 200 MB).
  2. Check the recommended format and quality; change them with the dropdown and slider if needed.
  3. Enter a max size to reduce resolution when you need a smaller file.
  4. Zoom in with the comparison slider, then download.

Frequently asked questions

Why did saving at quality 100 make my JPEG bigger?

Re-encoding knows nothing about how the original was compressed; it only sees pixels. At 100 the encoder treats the old JPEG block noise as real detail and works hard to keep it. Use 70–80, or switch to WebP.

My PNG got larger after compressing.

PNG is lossless, so there is no quality to lower, and the browser's built-in PNG encoder is less efficient than dedicated optimisers. Use WebP or JPEG for photos, or the high-quality WebP the tool suggests for logos.

Where is the AVIF option?

Your browser's canvas cannot encode AVIF. Displaying AVIF and encoding it are separate features. Try a current Chromium-based browser.

Is it fine to compress the same photo several times?

Every lossy save adds new error on top of the old. Compress once, from the finished original.

Related guides

Sources

Last reviewed:

Privacy and how data is handled