induwara.lk
induwara.lkImage · Privacy-first

Image Compressor — JPG, PNG, and WebP

Shrink JPG, PNG, and WebP files by 50–90% — fully inside your browser, no signup, no upload. Pick a quality preset, batch up to 50 images, optionally resize the longest side, and download. Sources cited.

By Induwara AshinsanaUpdated May 11, 2026
Image CompressorJPG · PNG · WebP · in-browser
Files stay on your device

Everything runs in your browser. Nothing is uploaded.

What this does

Drops in a JPG, PNG, or WebP image and re-encodes it through your browser's built-in compressor at the quality you pick. Photos typically shrink by 50–90% with no visible change at viewing size. PNG → WebP often saves over 80%.

Output format
Resize (longest side)
Preset: Balanced

Lower is smaller. PNG ignores this slider (lossless).

Quick presets
Images queued
0
Add an image to start
Input size (total)
0 B
Compressed size
Press Compress to compute
Saving
Ready to compress

Add at least one image to get started.

Estimator uses an empirical bits-per-pixel curve fitted to the JPEG and WebP corpora cited in the "Sources & references" section. Actual size is set by your browser's built-in encoder and may differ by ±10–20% depending on image content. Last verified 2026-05-11.

How it works

Modern browsers ship with built-in JPEG, WebP, and PNG encoders reachable through one Web API: HTMLCanvasElement.toBlob(callback, mimeType, quality). The compressor draws your image into an off-screen canvas, asks the browser to encode it at the chosen quality, and offers the resulting Blob as a download via an object URL. No part of the file leaves the page — you can watch your browser's Network tab while using the tool to confirm.

The encoded byte count depends on three things: pixel count, encoder family, and quality setting. Pixel count is a direct multiplier (twice the pixels, roughly twice the bytes). The encoder family sets a baseline — WebP averages 25–34% smaller than JPEG at equivalent perceptual quality, per Google's published WebP study. Quality moves you along a non-linear curve: between q=90 and q=100 the size doubles for almost no visible improvement; between q=40 and q=60 the size halves for noticeable quality gain.

The size estimator on the tool uses an empirical bits-per-pixel curve fitted to JPEG-corpus measurements and the WebP study numbers:

bpp_jpeg(q) = 0.05 + 1.4 × (q / 100)^2.5
bpp_webp(q) = bpp_jpeg(q) × 0.70
bytes       = (pixels × bpp) / 8  +  ~1 KB header overhead

The 0.05 term is the asymptotic floor: even at quality 0 a JPEG file needs that many bits per pixel for the quantised DCT coefficients and Huffman tables. The 2.5 exponent captures the steep growth in size between quality 60 and 90 — the region where most visible detail is preserved. The estimator is cross-checked against a second formula that linearly interpolates a five-point lookup table; the two land within ±5% on every quality between 1 and 100. The page above runs the estimator on the first queued image; the actual encoder may differ by ±10–20% depending on image content (textured photos encode larger than flat-colour graphics at the same quality).

For each image the tool does five deterministic things:

  1. Validate. Confirms the file is JPG, PNG, or WebP and within the size cap of 50.0 MB. Rejected files leave a specific reason in the queue rather than failing silently.
  2. Decode. Loads the image into an HTMLImageElement so the browser uses its native decoder. Natural width and height are read from naturalWidth / naturalHeight.
  3. Resolve dimensions. When a resize preset is selected, the longest side is scaled down to fit, preserving aspect ratio to the nearest pixel. Images are never scaled up.
  4. Re-draw. The image is painted onto a new canvas at the target size withimageSmoothingQuality = "high" (a bicubic-class resampler in current browsers). For JPEG output, the canvas is pre-filled with white so transparent source pixels don't turn black.
  5. Encode & download. canvas.toBlob produces the compressed Blob with the requested MIME type and quality. The Blob is wrapped in an object URL and offered as a download with the matching file extension.

Worked examples

Phone photo at JPEG quality 80

A 4032 × 3024 iPhone or Galaxy JPEG straight from the camera roll, compressed at high quality (80). The image stays sharp on a 4K display while losing roughly two-thirds of its file size.

  1. Pixels: 4,032 × 3,024 = 12,192,768
  2. Encoder: JPEG at quality 80
  3. Estimate (curve): ≈ 1.2 MB
  4. Cross-check (lookup): ≈ 1.3 MB
  5. Typical source: 3.1 MB saving ≈ 60.65%

Full-HD screenshot as WebP

A 1920 × 1080 desktop screenshot saved as PNG by the OS, re-encoded to WebP at quality 70. WebP averages 25–35% smaller than JPEG at equivalent perceptual quality (Google WebP study), so the saving over the lossless PNG is dramatic.

  1. Pixels: 1,920 × 1,080 = 2,073,600
  2. Encoder: WEBP at quality 70
  3. Estimate (curve): ≈ 111.6 KB
  4. Cross-check (lookup): ≈ 111.6 KB
  5. Typical source: 1.7 MB saving ≈ 93.65%

Social-media square at JPEG quality 55

A 1080 × 1080 image trimmed to fit under chat-app upload limits. Compact quality (55) is the smallest setting that still looks acceptable on a phone screen without obvious blockiness.

  1. Pixels: 1,080 × 1,080 = 1,166,400
  2. Encoder: JPEG at quality 55
  3. Estimate (curve): ≈ 52.8 KB
  4. Cross-check (lookup): ≈ 55.0 KB
  5. Typical source: 390.6 KB saving ≈ 86.47%

Quality presets at a glance

Each preset chip on the tool maps to a quality value on the 0–100 scale that canvas.toBlob accepts. The same q-value is read by every browser's JPEG and WebP encoder, so the same preset behaves consistently across Chrome, Edge, Firefox, and Safari.

PresetQualityTypical use
Max92Visually lossless on JPEG. ~30% smaller than the source.
High82Good for hero photos and product shots. ~50% smaller.
Balanced70Default. Sharp on screen; ~65% smaller than the source.
Compact55Strong compression for chat / email. Light artifacts at 100% zoom.
Aggressive40Smallest viable size. Visible blockiness on flat colour areas.

Frequently asked questions

Sources & references

Related tools

Rate this tool
Be the first to rate

Comments & feedback

Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.

Found a bug, edge case, or want to suggest an improvement?

Email me at [email protected] — most fixes ship within 24 hours.