Image compressor

Compare file size and export PNG, JPEG or WebP. PNG keeps transparency without a quality slider. WebP supports transparency with adjustable quality. JPEG replaces transparency with the selected background colour. A smaller quality value does not guarantee a smaller file than your original.

PNG, JPEG and WebP · up to 20 MB and 24 megapixels. Large images are reduced to a 4096px longest edge for editing. Keep your original file.

Enable JavaScript to edit your image.

SVG editor

How this workspace works

1. Remove background

Choose portrait AI for people. For products on a plain backdrop, use solid-colour removal and click the background. Inspect edges before exporting; hair, glass and similar foreground/background colours can be difficult.

2. Resize

Enter dimensions in pixels. Lock proportions to avoid stretching. Centre-crop fills the target size and may trim the edges; contain fits the whole image inside it.

3. Compress & download

PNG keeps transparency without a quality slider. WebP supports transparency with adjustable quality. JPEG replaces transparency with the selected background colour. A smaller quality value does not guarantee a smaller file than your original.

PNG or JPEG: compare alpha, pixels and bytes separately

The geometric examples use our demonstration graphic; the separate photo cases use credited public photographs. These are controlled tests, not customer experiences. Download the exact input and outputs to inspect the result yourself.

800 by 600 input: blue bottle-shaped object and yellow circle on a pale background.
Original input: 800 × 600 · 16,779 bytes

The two 400 × 300 files below were exported from the same cutout. PNG retains transparent pixels; the JPEG was flattened onto white. The saved fixtures are 6,343 bytes (PNG) and 5,440 bytes (JPEG). These are measured files, not a promised reduction for another image.

Choose the required background first, then compare formats. A smaller JPEG that lost necessary transparency is not an equivalent replacement for a PNG logo. For photos that need no transparency, compare JPEG/WebP at the same pixel dimensions and inspect fine text, edges and gradients before downloading.

The original fixture is 800 × 600 and 16,779 bytes. Because these exports also halve the dimensions, their size difference from the original cannot be attributed to compression alone. PNG has no quality slider; JPEG/WebP encoder results depend on the browser and image. Lowering quality repeatedly can damage detail without meeting a target file size.

Transparent PNG · 400 × 300
Transparent PNG · 400 × 300 · 6,343 bytes
Download this result
White JPEG · 400 × 300
White JPEG · 400 × 300 · 5,440 bytes
Download this result

Cat fur at the same pixel size: compare three actual exports

Open the 451 × 300 CC0 Chelsea photograph. Keep original dimensions and the complete image; skip background removal. Export JPEG at quality 85, JPEG at 60, then WebP at 85. All files below came from the browser download button in the existing tool, using the same input pixels. Quality numbers from different formats do not imply equivalent visual quality.

Original lossless PNG · Chelsea
Original lossless PNG · 451 × 300 · 240,512 bytes
Download and inspect at 100%
JPEG · 85% · Chelsea
JPEG · 85% · 451 × 300 · 27,729 bytes
Download and inspect at 100%
JPEG · 60% · Chelsea
JPEG · 60% · 451 × 300 · 15,573 bytes
Download and inspect at 100%
WebP · 85% · Chelsea
WebP · 85% · 451 × 300 · 21,594 bytes
Download and inspect at 100%

JPEG 60 uses 12,156 fewer bytes than JPEG 85 here, with no pixel reduction. Compare whiskers, fur around the eyes and the smooth background at 100% zoom. A thumbnail can hide lost detail. These are lossy replacements for a lossless PNG, not evidence that every photo can lose that many bytes without a visible cost. For a 20 KB upload limit (20,000 bytes), the 15,573-byte JPEG 60 fits this example; check your own exported bytes and acceptable detail.

Credit: Stefan van der Walt · CC0, via scikit-image Chelsea documentation. Browser exports: 19 November 2026; another encoder may produce different bytes. Sources and usage notes

A transparent banner under 100 KB: compare the actual downloads

Start with the saved 512 × 512 AI cutout from the credited NASA portrait case. We reopened that exact 361,936-byte file in this workspace, unlocked proportions and selected 400 × 300 with Contain. This follow-up test changes the layout and export format; the original AI edge limitations still apply.

The scale is min(400/512,300/512)=0.5859375. The portrait canvas becomes 300 × 300 inside a 400 × 300 output, leaving 50px on each side. The subject is not stretched to 4:3. With Centre-crop instead, the square would scale to 400 × 400 and lose 50px above and below; that can cut off the head or held object.

PNG · transparent · 400 × 300
PNG · transparent · 400 × 300 · 132,565 bytes
Download the actual export
WebP 85 · transparent · 400 × 300
WebP 85 · transparent · 400 × 300 · 21,436 bytes
Download the actual export
JPEG 85 · white background · 400 × 300
JPEG 85 · white background · 400 × 300 · 18,277 bytes
Download the actual export

Suppose an upload requires transparency and a maximum of 100 KB (100,000 bytes). PNG is over that limit here; the 21,436-byte WebP meets both conditions if the destination accepts WebP. The 18,277-byte JPEG is smaller but its white rectangle will cover a coloured page background. If the destination accepts only transparent PNG, keep that requirement and adjust dimensions or use another preparation method; changing to JPEG does not satisfy it.

These browser downloads use the same 400 × 300 pixels. Size changes from the 512 × 512 input include resizing as well as encoding. WebP/JPEG are lossy; inspect hair and helmet edges against your intended background. Credit: NASA · Eileen Collins. Source and usage notes · Settings, bytes and transparency record

Geometric fixture export date: 17 November 2026; photograph exports: 19 November 2026. Explanation reviewed: 19 November 2026. Layout values are rounded; re-encoding in another browser may produce different bytes.

Your image is processed on this device. Portrait AI downloads a model from Hugging Face; image pixels are not sent there. Site analytics and advertising may make separate network requests.

MODNet / Xenova (Apache-2.0) · License