Image Compressor

Image Compressor

Shrink a PNG, JPG or WebP while keeping the same pixel dimensions and format. Choose Smallest, Balanced or Best quality for JPEG and WebP, or batch 2–10 images into one ZIP.

A smaller file does not change the margin. The price does.

If you sell the product, work out what you keep per order. The Profit calculator subtracts marketplace fees, shipping and packaging and shows the break-even order count.

Details — who it's for & how it works

For: site owners, designers and developers who want a smaller file in the same format as the source.

How it works: upload → compress → compare sizes → download.

Use this when the format is already right and only the bytes are too high. If the format is also wrong for the destination, the WebP Converter changes format in one step. See the JPEG vs PNG vs WebP format guide.

Before and after, with measured numbers

The sample photo below is our own test image, not a user upload. The output files are the real output of this tool run on it, and every size here is measured from the file, not estimated.

JPEG compressed at Balanced quality

Sample photo of a ceramic mug before compression
Before  900×720 px  ·  JPEG  ·  209.2 KB
The same photo after compression, at the same dimensions
After  900×720 px  ·  JPEG  ·  98.9 KB

209.2 KB → 98.9 KB · 53% smaller

Both files are the real output, so you can check them: source file  ·  compressed file. A re-encode is not guaranteed to be smaller for every image — a tightly optimised source can come back the same size or a little larger, and the result panel tells you when that happens.

What is image compression?

Image compression is the process of re-encoding an image file so it takes fewer bytes while keeping the visible content close enough to the source to be useful. The two main kinds are lossless compression, which preserves every pixel exactly and is what the PNG format always uses, and lossy compression, which discards some pixel detail in exchange for a much smaller file and is what JPEG and lossy WebP use. Most production web imagery is a balance between the two.

This compressor works in the same format as the source — a JPG stays a JPG, a PNG stays a PNG, a WebP stays a WebP — and re-encodes the file with a balanced quality default per format. It never resizes, crops or upscales, and it never silently changes the file format.

Why compress an image?

  • Faster page loads. Smaller image payloads reduce download time and decoding work on the user's device, which directly improves the page experience.
  • Email and form upload limits. Many email services and CMS forms reject files above a few MB. Compressing first lets the same image go through.
  • Re-using an old asset at a new, smaller budget. A PNG or JPG from a previous project can be brought back to a tighter file size band without re-designing the image.
  • Keeping the same format in your repo or CMS. When the destination already speaks the source's format, re-encoding in place is more useful than swapping to WebP.

Compression does not guarantee a smaller file for every source. A tightly optimised source may end up similar in size or fractionally larger after a re-encode. The result panel on this page shows the measured sizes so the comparison is honest.

Quick Answer

The Image Compressor reduces the file size of a single PNG, JPG or WebP image in the same format as the source and at the same pixel dimensions. PNG is re-encoded with Pillow's optimize pass on; JPEG defaults to quality 80 (Smallest 62 and Best 92, or an advanced 1-100 value, are selectable) with alpha flattened on white; WebP defaults to quality 80 — lossy modes map to 70 / 80 / 94 — and stays lossless whenever the source has transparency. The output keeps the source extension and is a drop-in replacement for the original.

Requirements

Supported input
PNG, JPG, JPEG or WebP, up to 10 MB. SVG and GIF are not accepted: SVG is a vector format and GIF needs animation-aware processing the MVP does not include.
Output format
A single file in the same format as the source, named after it. PNG keeps its PNG extension, JPG keeps JPG, WebP keeps WebP. The format never changes silently.
Dimensions
Preserved exactly. A 1200 × 800 source becomes a 1200 × 800 output. No resize, no crop, no upscale.

How it works

  1. 1 Upload. Choose a PNG, JPG or WebP file up to 10 MB.
  2. 2 Compress. The compressor re-encodes the file in its original format: PNG with optimize on, JPG or WebP at the chosen quality (Balanced 80 by default; Smallest and Best for JPEG map to 62 and 92, for WebP to 70 and 94). A transparent WebP stays lossless whatever you pick.
  3. 3 Compare and download. The result panel shows the measured original size, the compressed size, the bytes saved and the percentage change. Download the smaller file in the same format.

Compressing for the web

Image compression only matters in the context of a real page delivery budget. Chrome for Developers publishes the Lighthouse audits PageSpeed Insights actually run, and the two audits that touch images are stated independently:

  • Efficiently encode images asks whether the file could have been smaller at the same rendered dimensions by using a more efficient format or encoder. Per the Chrome for Developers audit docs, the threshold is approximately 4 KiB of potential savings per image.
  • Properly size images asks whether the rendered display size on the page is meaningfully smaller than the source's intrinsic pixel dimensions. The Lighthouse audit flags an image when the displayed pixel size is far smaller than the file's actual pixel size, regardless of compression level.

Compressing an image that is too large on the page does not solve the Properly size images flag — the page would have to ship a smaller render box or a smaller source. Compressing an image that is already close to its render box does not earn Efficiently encode images credit if the file is already tightly encoded. The two audits are independent and the page must address both to clear the image-delivery section of a Lighthouse run.

When this compressor is the right tool

The source is already the right pixel dimensions for the layout and the goal is one balanced re-encode in the source format. Use it as part of a CMS upload pipeline, an email attachment, or any context where the destination already speaks the source format.

When this compressor is the wrong tool

If the source is much larger than what the page actually renders, resizing the canvas first is the right move — the Social Media Image Resizer covers documented social-platform sizes, and the OG Image Generator produces a 1200 by 630 PNG for share-card use cases. If the goal is a specific KB target (for example, an email-cap of 100 KB), use Compress to KB — it sweeps encoder quality toward your budget. This page stays the one-default compressor for a balanced re-encode in the source format.

Common compression mistakes

These are the issues that come up most often when compressing an image. Each one is rooted in a property of the format or the encoder rather than in this specific tool.

  • Expecting a fixed percentage reduction. The output size depends on the source content, the source's existing compression level and the chosen quality. A tightly optimised source may shrink very little; a flat-colour graphic shrinks a lot. Compare the measured sizes on the result panel before deciding whether to keep the output.
  • Confusing compression with resizing. Compression keeps the same pixel dimensions and reduces the file size. Resizing changes the pixel dimensions (and usually the file size as a side effect). If you need a smaller canvas, use a resizer first; if you need a smaller file at the same canvas, use this compressor.
  • Compressing an already heavily compressed file. A JPG saved at quality 80 then re-encoded at quality 80 may end up roughly the same size or fractionally larger; the same is true for a tightly optimised WebP. Use the original in that case. This tool is most useful when the source was saved with conservative settings or has been edited since it was last encoded.
  • Animating a flat PNG or WebP and losing the frames. This compressor runs on the first frame Pillow decodes, so an animated PNG or animated WebP source is flattened to a single frame in the output. If you need an animation-aware compressor, take the source into a tool that handles the frame schedule.

Check the output

After the compressor runs, verify these four things on the actual file before you upload it anywhere. The compressor shows the byte counts on the result panel; the rest of this list is a quick visual check that the smaller file is still the right file.

  • Dimensions. Confirm the source's pixel dimensions still match the destination display slot. Compression does not change dimensions — the output is the same width and height as the input — but the check matters because compression alone does not fix an image that is far larger than what the page renders. Chrome for Developers' Properly size images Lighthouse audit is the first-party reference for that case; if the source has more pixels than the layout uses, resize before compressing, do not rely on compression to make up for it.
  • File size. Confirm the compressed bytes are at or below the destination's documented limit (a CMS upload cap, an email attachment cap, a page payload budget) and below the size you actually need. The result panel shows the measured original and compressed sizes for the file you uploaded, so the comparison is honest. Chrome for Developers' Efficiently encode images Lighthouse audit flags images that could save roughly 4 KiB or more by a more efficient encoder or format — that is the page-level signal, not a per-file target.
  • Visual quality. Open the output at the actual display size and look for JPEG block artefacts on text and sharp edges, colour banding in sky or gradient regions, broken or white-haloed transparency, and smearing of fine detail (hair, fabric texture, small UI elements). Pillow's quality 80 on the 0 to 100 scale is the balanced default this compressor uses; if the visual check fails, the right move is to switch format (lossless PNG or lossless WebP for transparency, JPEG or WebP for a photograph) or to lower the compression level rather than to keep a broken file. A dedicated walkthrough of these four symptoms and their fixes lives on the over-compressed image guide.
  • Real destination. Upload the final file to the actual page, CMS, email or design tool where it will be used, and view it there. Browser preview, design-tool preview and the live page can render colour, transparency and layout differently; the live destination is the only check that catches all of them at once. This is the same check the Optimize Images for the Web guide recommends, and it is the last step before the file is shipped.

Image Compressor vs WebP Converter

The two workflows answer different questions and they pair well rather than overlap. The Image Compressor reduces the file size of a PNG, JPG or WebP image while keeping the source format and the source dimensions. The WebP Converter changes the file format to WebP and may also produce a smaller file as a side effect, depending on the source and the WebP encoder settings. Use the compressor when you need a smaller file in the same format as the source. Use the WebP Converter when you want to ship WebP and the destination reads WebP. Combining both — first compress in the source format, then convert to WebP — is also a reasonable pipeline if the source is large.

WebP does not always produce a smaller file than an equivalent PNG or JPG, especially for small flat-colour graphics where the per-frame metadata is a noticeable share of the total bytes. The two tools report measured sizes, not promised reductions; the right tool for a given file depends on what the destination reads and how the source compresses, not on which tool claims a larger reduction.

Image Compressor vs Compress to KB

The two workflows answer different questions and they pair well rather than overlap. The Image Compressor uses one balanced default per format and never changes format or dimensions — a PNG stays a PNG, a JPG stays a JPG, a WebP stays a WebP, and the pixel count is preserved exactly. The Compress to KB sweeps quality toward a user-set KB budget and may change format (PNG → WebP, PNG → JPEG) or scale dimensions when the budget cannot be met at the source settings. Use this Image Compressor when the destination already accepts the source format and there is no byte budget. Use the Compress to KB tool when a destination asks for "under X KB" or "max Y KB" — the result panel on that tool reports whether the budget was met and whether the tool changed format or scaled.

Both tools report measured sizes on the result panel, not promised reductions. The Compress to KB tool is honest about the cases where the target cannot be hit — the panel shows the best-effort file and a "Could not reach X KB" note rather than padding the result. Pair the two tools when one is not enough: first use the Image Compressor for a balanced same-format re-encode, then run Compress to KB only if the destination also enforces a specific byte budget.

What the compressor actually changes

The compressor is a single re-encode in the source's own format. Each format has a different encoder with different trade-offs — the behaviour below is the real per-format path the workflow runs, not marketing shorthand.

PNG

Re-encoded with Pillow's optimize=True pass and no quality setting, because PNG is a lossless format and a quality knob would be meaningless. Pillow spends more time choosing the best filter strategy and chunk layout to find a smaller file. Alpha is preserved exactly when the source carries it.

JPEG

Re-encoded at Pillow quality 80 by default — Smallest (62), Best (92) or an advanced 1-100 value override it — with optimize=True. JPEG has no alpha at all, so any transparent source is composited on solid white before the encode. Progressive mode is off on purpose: progressive JPEGs are larger, not smaller, at the same nominal quality.

WebP

If the source has transparency the encoder is asked for lossless=True so the alpha channel survives verbatim — the quality control does not apply. An opaque WebP is re-encoded lossy at quality 80 by default (Smallest 70, Best 94, or advanced 1-100) with method=4 — measured against Pillow's slowest setting, 6, on real-size images: method 6 costs 1.3-2.9x the encode time for a file that differs by under 0.6 % in size and is occasionally larger, so the extra seconds buy nothing a viewer can see.

The compressor never resizes, crops or upscales. It also never silently changes the file format: the downloaded file keeps the source's extension, and the file bytes match that extension. A misnamed upload (for example a PNG saved as photo.jpg) is detected by Pillow's decoder and written out with the correct extension so the file content and the file name agree.

Reading the result panel

The result panel shows three measured values: the original file size (read from the upload), the compressed file size (read from the downloaded file) and the bytes saved. There is no promised reduction and no estimated number — the panel is the same measurement you would make with any file-size tool, on the same source bytes.

Three outcomes are possible, and all three are shown honestly:

  • Smaller. The most common case. The output bytes are fewer than the source and the panel shows the absolute saved bytes plus the percentage. The output is a drop-in replacement for the original at the same dimensions and the same format.
  • No change. A re-encode at the same effective quality as the source can come out the same size to the byte. The panel shows Same size as original rather than disguising it as a small positive reduction. Keep the source if the file is already at the format and quality you want.
  • Larger than original. Rare but real. A small flat-colour PNG carries per-frame metadata that can make a re-encoded file a few hundred bytes bigger than the source. The panel shows Larger than original — keep the source. Do not replace the original with the output in this case.

The bytes-saved number is the source's own measurement, not an average for the format. Treat it as one data point: it tells you what happened on this specific file, not what will happen on the next file you compress.

About this Image Compressor

This page reduces the file size of a single PNG, JPG or WebP image in its original format and at the source's pixel dimensions — no resize, no crop, no upscale, and no silent format change. Beita Image is an image workflow platform that prepares images for websites, apps and online platforms; each workflow takes one uploaded asset and produces a ready-to-ship output. The companion WebP Converter turns a PNG, JPG or WebP image into a WebP file at the source pixel dimensions when the destination reads WebP. The Social Media Image Resizer resizes one image to a documented LinkedIn, X (Twitter) or YouTube feed-post size. The OG Image Generator produces a 1200 by 630 Open Graph preview PNG used as a social link-share card.

Sources

Each factual claim on this page — encoder parameters, format behaviour, browser compatibility and the WebP lossless option — is sourced from the canonical documentation below.

Related tools

Other image workflows that ship ready-to-use packages.

Decision guide

If the bytes are still too big, do you actually need to compress — or do you need to resize first? A short guide covers the difference between pixel dimensions and file size.

Optimize images for the web: a practical guide

A four-step workflow — pick the format, resize to the display slot, re-encode at a balanced quality, serve with a modern-format fallback. Backed by web.dev, MDN and Chrome for Developers.

Resize vs Compress: which one actually shrinks your image

Resizing changes the pixel dimensions; compression keeps the dimensions and rewrites the bytes. Chrome for Developers' two Lighthouse audits map directly to the two operations.

JPEG vs PNG: which format should you actually use

Pick JPEG for photographs; pick PNG for graphics, screenshots and any image that needs transparency. The MDN format guide, WHATWG and the Pillow documentation back the comparison.

Frequently asked questions

What does an image compressor do?
Shrinks the file size of a single JPG, PNG or WebP image while keeping the original pixel dimensions. The output is in the same format as the source so the file is a drop-in replacement: a 1200 by 800 JPG becomes a 1200 by 800 JPG, a 1200 by 800 PNG becomes a 1200 by 800 PNG, and a WebP stays a WebP. The tool never resizes, crops or upscales, and it never silently changes the file format on you.
Will the compressed file always be smaller than the source?
Usually, but not always. PNG is re-encoded losslessly with the encoder's optimize pass on, so the output is normally smaller than a non-optimised source. JPEG and WebP depend on the source's quality setting and content: a JPG that was already saved at quality 80 may end up very similar in size after a re-encode at the same quality. The result panel shows the measured sizes so you can compare before deciding whether to keep the output.
Does image compression change the dimensions of the image?
No. The compressor keeps the source's pixel dimensions exactly: a 4000 by 3000 source becomes a 4000 by 3000 output, with no resize, crop or upscale. The width and height are preserved on every file so the result drops into the same layout slot the original occupied. The tool never upscales a small image to a larger one and never crops the edges off the source.
Will PNG transparency survive image compression?
Yes for PNG and for the WebP output when the source has transparency. PNG is a lossless format, so re-encoding a PNG with the optimize pass on keeps alpha exactly as it was. WebP sources that carry transparency are re-encoded with lossless mode so the alpha channel survives. JPEG cannot carry transparency at all, so a transparent source is composited on solid white before the JPEG encode. Pick PNG or WebP if you need transparent output.
Can I compress an image to a specific file size like 100 KB?
Not on this page. Image Compressor uses one balanced default per format — PNG with optimize on, JPEG and opaque WebP at quality 80, transparent WebP lossless. For a specific KB budget, use Compress to KB (/compress-to-kb), which sweeps quality toward your target. Use this compressor for a single balanced re-encode in the source format.
What is the difference between compressing an image and converting it to WebP?
Compressing keeps the file format the same — a JPG stays a JPG, a PNG stays a PNG — and reduces the bytes through format-appropriate encoding. Converting to WebP changes the format to WebP while keeping the dimensions. The two shrink the same image for different reasons: a compressor re-tunes the encoder, while a WebP converter swaps the format. Use this compressor when you want the source format; use the WebP Converter when the destination reads WebP.
What quality does the image compressor use?
By default JPEG and opaque WebP are re-encoded at Pillow quality 80, the balanced setting; PNG gets Pillow's optimize pass with no quality number because PNG is lossless, and transparent WebP stays lossless so the alpha channel survives. You can pick Smallest (62), Balanced (80) or Best (92) for JPEG, or an advanced 1-100 value; WebP modes map to 70 / 80 / 94. The result panel shows the quality actually applied.
What does Google recommend for image compression?
Chrome for Developers publishes the Lighthouse audit guidance that most performance audits run. The Efficiently encode images audit flags images that could save roughly 4 KiB or more by a more efficient encoder or format, and the Properly size images audit flags images whose rendered display size is far smaller than the source dimensions. Both pages are the first-party references for what a PageSpeed Insights run will flag, and they are linked in the Sources block below.