Image Compressor — Batch-compress JPG / PNG / WebP right in your browser
Every image is compressed locally in your browser; nothing is uploaded to a server. Pick files, drag them in, paste a screenshot, or load a batch from URLs. On import each image is rotated according to its EXIF orientation, so portrait phone photos no longer arrive sideways. There are four ways to compress: lower the quality only, shrink the resolution only, mix both, or aim for a target file size — type 200 KB and the tool runs a binary search over the quality setting until the result just fits. On the resolution side you can scale by percentage, cap the long edge, or set exact dimensions, with a minimum-edge floor so nothing ends up illegible. Output can be JPEG, PNG, WebP or AVIF; when the original is a PNG the tool suggests WebP for a much smaller file. PNG also supports lossy palette compression, the alpha channel can be kept or dropped, and when converting to JPEG you choose the fill colour for transparent areas. Preview offers side-by-side and draggable split comparison, a magnifier for inspecting noise, and a checkerboard backdrop for transparency. Export a single image, download a ZIP, copy the image or its Base64 string, and in batch mode fine-tune each file individually or export a CSV manifest. All processing happens on your machine, so it works offline and adapts to phone, tablet and desktop.
Import images
Compression mode
Output format
Picks the smallest sensible format based on the source and browser support
AVIF gives the smallest files but older browsers cannot open them
JPEG has no transparency, so transparent areas become the colour above
Reducing the colour count shrinks the file a lot, at the cost of banding in gradients
File name
Example: aidotool_compressed.jpg
How to use
- Drop your images into the box above, click “Choose images” to pick several at once, or just press Ctrl+V to paste a screenshot. To fetch from the web, paste the address into the URL field. Photos taken on a phone are auto-rotated from their EXIF data, so no manual rotating is needed.
- Pick a compression mode. For the easiest route choose “Target size” and type 200 KB — the tool binary-searches for the lowest quality that still fits. If you prefer control, use “Quality” and watch the size readout update as you drag. Choose “Resolution” to shrink dimensions only, or “Mixed” to resize first and then lower quality for the smallest file.
- Decide the output format under “Output format”. A PNG original usually shrinks a lot when converted to WebP. Keep transparency by staying on PNG or WebP; converting to JPEG fills transparent areas with the colour you pick.
- Compare the original and the result on the right. Switch to “Slider” and drag the divider to inspect the same spot in both, or press and hold the image to magnify and check for noise. When it looks right, download it, zip up several files, or export a CSV manifest to check every file size at a glance.
Frequently asked questions
Should I use By quality or By target size?
By quality means you pick the sharpness and let the file size fall where it may — drag the slider and watch the readout, which suits cases where you only need it not too large. By target size means you pick the size and let quality follow — type 200 KB and the tool binary-searches quality until the file just fits, which is what you want when an upload endpoint enforces a hard limit.
Why did my file get bigger after compressing?
Usually because the original was already squeezed hard, so re-encoding is a second round of loss and can end up costing more bits; or because you gave an already-small JPEG a lossless format like PNG, which naturally comes out larger. In that case keep the original, or try WebP instead.
PNG will not reach my target size. Why?
Because PNG is lossless — the quality parameter barely moves its size, so binary-searching quality gets nowhere. Switch the output format to WebP, JPEG or AVIF to hit a size target; if you must stay on PNG, the only levers are fewer pixels or fewer colours.
My transparent image came out with a white background. What happened?
The output format was JPEG, which has no alpha channel, so the transparent area gets filled with your chosen background colour. To keep transparency use PNG, WebP or AVIF — all three carry alpha. Turning on the checkerboard preview lets you see at a glance whether the transparency survived.
The quality dropped too far. How do I find the balance?
Hold the magnifier over the preview and look for noise and blocking. Around 80 percent is usually the threshold where the eye starts to notice, and below that it falls apart quickly. You can also switch to By target size and give a slightly generous limit, letting the tool find the highest quality that still fits.
What is it
Compression means describing the same picture with less information, and there are two routes: store fewer pixels by shrinking the resolution, or store fewer bits per pixel by lowering quality and reducing colours. The first saves more and saves it predictably; the second saves faster but shows blocking and noise once you push too far. Size and quality are not linear — dropping quality from 100 to 85 often looks identical while halving the file, and going from 85 to 70 starts to smear, so finding the knee of the curve beats dragging the slider to the bottom.
Origin & history
The theoretical ground was laid by Shannon in 1948: “A Mathematical Theory of Communication” defined entropy and effectively told everyone how many bits a picture needs before information is lost. Run-length coding and Huffman coding appeared in the 1950s — the former suited fax pages with large uniform areas, the latter assigned shorter codes to more frequent symbols, and both still form the final stage of JPEG, PNG and ZIP today. In 1974 Nasir Ahmed and colleagues proposed the discrete cosine transform, moving an image from the spatial domain into the frequency domain and handing lossy compression the right mathematical tool; the first practical vector quantisation schemes followed in 1984. Standardisation proper began in 1986, when ISO and CCITT jointly formed the JPEG committee. By 1987 the core design was settled — 8×8 DCT, quantisation tables, zig-zag scanning and Huffman coding — and in 1992 it was published as ISO/IEC 10918, the format we simply call JPEG. Around the same time Lempel-Ziv dictionary compression was used in GIF (1987), but a patent dispute over LZW pushed the community to start over, and PNG arrived in 1996 with lossless deflate plus per-row filtering, becoming the standard for web graphics. JPEG 2000 tried to replace the DCT with wavelets in 2000; it produced better images at the same size but cost more computation and more patent complexity, and never displaced JPEG. Google released WebP in 2010, porting VP8's intra-frame coding to still images for roughly thirty percent smaller files with alpha and animation support. The Alliance for Open Media shipped AVIF in 2019 on top of AV1 keyframes, with a clear advantage at high compression ratios, at the price of slow encoding and poor support in older browsers. The through-line of these thirty years is plain: the algorithms grew steadily more elaborate, the gains grew steadily smaller, and the bottom line — that the human eye should not be able to tell — never moved. One footnote: around 2020 encoders began pulling in machine learning. Google's Guetzli reorders the quantisation table with a psychovisual model and lands about thirty percent smaller than baseline JPEG at matched quality, at the cost of minutes per image — which makes it a fit for offline batch processing on a server rather than something a browser does live.
Related keywords
Feedback
Found a problem with a tool or have a suggestion? Email us — we read every message.
