NV ToolkitFormat · Validate · Convert

Image Tools

Image Compressor

Shrink JPG, PNG and WebP images in batches — pick a quality preset or a KB target, watch each file's exact savings, save what you like.

In short

An image compressor re-encodes a picture so the file is smaller: lossy at a lower quality for JPEG and WebP, lossless for PNG. It runs each format's reference encoder as WebAssembly in your browser (mozjpeg, oxipng, libwebp), offers three presets or a KB target, shows every image's before and after size, and never returns a file larger than the original.

By NaveenKumar T · Updated

Learn: How to Compress Images for the Web (Without Ruining Them)

  • Per-image savings shown
  • 3 quality presets or a KB target
  • Batch compression

Runs entirely in your browser — nothing you paste or open here is uploaded, logged, or stored.How we handle data →

Learn more

Compressing JPG, PNG & WebP images, explained

Image compression is a quality-for-bytes trade, and this tool makes the trade visible: every compressed image shows its original size, new size, and percentage saved right on its card, so you judge each result instead of trusting a black box. The three preset tabs map to the decisions that matter — High Quality (≈85%) for hero images and portfolios, Balanced (≈70%) for general web use where most photos live happily, Max Compression (≈50%) for thumbnails and bandwidth-critical pages.

Each format keeps its identity: JPGs re-encode as JPG, PNGs as PNG, WebP as WebP. Under the hood, every format gets its reference encoder compiled to WebAssembly — mozjpeg for JPEG (progressive scan, optimized Huffman tables), oxipng for lossless PNG, libwebp for WebP — the same encoder class big image CDNs run server-side, so even images that were already compressed once usually shrink further. Switching presets keeps your queue and resets results, so comparing Balanced against Max on the same batch takes two clicks.

Running a mixed folder through one preset

Each file is routed by its extension and comes back in the same format, named name-compressed.ext. JPGs decode to pixels, are flattened onto white (a no-op for opaque JPGs) and re-encoded with mozjpeg at quality 85, 70 or 50. WebPs go through libwebp at the same three qualities with their alpha channel intact. PNGs never get decoded at all: oxipng rewrites the original bytes at optimization level 2, 3 or 4, so for them the presets change effort rather than quality and the pixels are identical. Typical outcomes at Balanced: a 4 MB camera JPG lands near 1–1.5 MB, a WebP exported at quality 90 roughly halves, and a PNG screenshot shrinks 5–25%.

A workable batch routine: run everything at Balanced, check the per-card numbers, then re-run only the stragglers with a byte budget at Max Compression — switching presets keeps the queue. Files that come back marked 'already optimized' were already smaller than the preset could produce and are returned untouched, so nothing in a batch is ever made worse. Because format is preserved, replacing files on a site is a rename: strip the -compressed suffix and overwrite. Be aware that JPG and WebP outputs carry no EXIF or ICC profile, and that each encoder loads on first use as a WebAssembly module, so the first image of each format takes a moment longer than the rest.

Compress to a target size (20, 50, 100, 200 or 500 KB)

Presets answer 'how good should this look'; Target Size answers the question that actually shows up in the real world — 'this upload form caps files at 100 KB' or 'the CMS rejects anything over 200 KB'. Instead of guessing a quality percentage and checking the result, pick the KB number the form actually enforces and the tool finds the highest-quality encode that still fits, using a binary search over JPEG/WebP/AVIF quality rather than one fixed guess.

The search always aims to land at or under your target, never over — a 100 KB budget typically produces something in the 90–100 KB range, not exactly 100.000 KB, because quality is a continuous dial and the search stops as soon as it finds a value that fits comfortably. If quality alone can't get there — a small KB budget against a large, detailed photo — the tool also steps the image dimensions down and re-tries, so an aggressive target still produces a usable, correctly-sized result instead of failing outright.

Help

Frequently asked questions

Everything you need to know about the Image Compressor.

01Which encoder handles each format, and which files come back unchanged?

Files are routed by extension and come back in the same format: JPG through mozjpeg, PNG through oxipng (lossless), WebP through libwebp and AVIF through libaom — each format's reference encoder compiled to WebAssembly. A file the encoder cannot make smaller is returned as your original bytes and the card reads "already optimized", so a batch is never made worse. GIF, BMP and TIFF are not accepted here; convert them first.

02Which preset should I use?

Balanced is the right default — for photographs the difference from the original is effectively invisible at normal viewing sizes. Use High Quality when images will be inspected closely (portfolio, product zoom) and Max Compression when speed beats fidelity (thumbnails, chat, email).

03Why do PNG files compress less than JPGs here?

PNG is lossless — quality presets don't apply to it, so savings come only from re-encoding efficiency and are typically modest. For big PNG wins, convert photographic PNGs to WebP or JPG instead (one click away in Related tools); keep PNG for graphics that need sharp edges or transparency.

04Can compression ever make a file bigger?

NV Toolkit's compressor never returns a larger file: when the re-encoded output is not smaller than the input, the original bytes are kept and the card is marked "optimal". You can only win or break even — which is why it is safe to run an already-optimised folder through it.

05Can I compress an image to an exact file size?

Close to it. Switch to the Target Size tab, pick a byte budget (20/50/100/200/500 KB or a custom value), and the tool binary-searches the JPEG/WebP/AVIF quality setting for the highest quality whose output still fits under your target — it always aims slightly under, never over, so a 100 KB target typically lands at 95–100 KB rather than exactly 100.000 KB. PNG has no quality lever (it's lossless here), so target size on a PNG runs a single optimization pass and reports whether that already met the target.

06Does the target-size mode ever change the image dimensions?

Only as a last resort. The search tries quality alone first; if even the lowest usable quality still produces a file larger than your target — a very small KB budget on a large photo — the tool steps the dimensions down (to roughly 85%, 70%, 55%, then 40% of the original) and re-runs the quality search at each size until one fits. You'll see this happen on aggressive targets like 20 KB for a multi-megapixel photo; ordinary web-size images usually hit the target on quality alone.

07What happens if my target is smaller than the image can realistically get?

The tool returns its smallest achievable result — the lowest quality at the smallest tried scale — and marks the card so you can see the target wasn't quite reached, rather than silently returning something misleadingly labeled. In practice this only happens with extreme targets (a few KB) on large or highly detailed source photos.

Keep working

Related tools

Learn the format

Related guides

All guides →