Buddy Code
Create account ↗
All tools
Free to use · No sign-up

Image compressor

Resize an image manually or compare JPEG and WebP at the same dimensions against a target byte size.

Both outputs keep the original pixel dimensions. JPEG uses a white background; WebP retains transparency. No automatic resizing.

Each codec uses a bounded search of encoder settings. Compare the actual previews: percentages do not measure equivalent quality across formats.

What it does

Resize an image manually or compare JPEG and WebP at the same dimensions against a target byte size.

How to use it

  1. Choose a JPEG, PNG or WebP up to 20 MiB. Manually adjust width and quality, or keep dimensions fixed and compare JPEG/WebP candidates against a target from 100 bytes to 20 MiB.
  2. WebP supports transparency. JPEG puts transparent areas on white. Animated PNG and WebP are rejected; original metadata is not retained.
  3. The comparison measures at most ten candidates per codec and shows whether each meets the budget. Inspect both previews and sizes; the search does not guarantee the best possible quality or a successful fit.
  4. Manual resizing accepts up to 40 megapixels. Fixed-dimension comparison accepts up to 16 megapixels and 8,192 pixels per side, with a cancellable 30-second deadline. Browser codec support and image content affect results.

Example

Compare a 1,200 × 800 image as JPEG and WebP against a 100,000-byte budget, inspect the measured quality candidates and preview both outputs before downloading.

Methodology

Manual mode uses Canvas to resize without upscaling and encode JPEG or WebP. Fixed-dimension comparison runs in a local worker, testing quality endpoints and a bounded search of at most ten measured candidates per codec. It returns the highest-quality measured candidate within the budget, or the smallest measured candidate when none fits; this is not an exhaustive optimum.

Limitations

20 MiB JPEG/PNG/WebP input with bounded signature/dimension checks before decode and post-decode verification; animated PNG/WebP and unsupported headers are rejected. Manual resizing up to 40 MP with output sides at most 8,192 pixels. Fixed-dimension comparison up to 16 MP / 8,192 pixels per side, target 100 bytes–20 MiB, ten attempts per codec, 64 MiB per encoded candidate and a cancellable 30-second deadline. Requires browser WebP/JPEG worker encoding support. File size can increase or remain above target. WebP preserves supported transparency; JPEG flattens it onto white. Original metadata is not retained; visual quality and browser encoding differ.

Automation

This tool runs in your browser. No upload API or MCP endpoint is available.

View capabilities and documentation

Reference updated

Join the conversation

Helpful tips, questions, and ideas for making this tool better.

Loading discussion…