Skip to content
AgileLogics

Image Compressor

Re-encodes an image at a lower JPEG quality to reduce its file size, using an in-browser canvas. Transparent areas are filled with white, since JPEG has no transparency.

How it works

Choose an image, adjust the quality if needed, and click Convert.

What is an image compressor?

An image compressor makes an image file smaller so it loads faster and fits under upload limits. This one re-encodes your image as a JPEG at a quality level you pick, from 10 to 100. Lower quality discards more fine detail and gives a smaller file. The width and height stay the same.

JPEG compression is lossy: it throws away detail the eye is least likely to notice, following the method in the JPEG standard (ITU-T T.81). The quality setting controls how aggressive that is.

How to compress an image

  1. Click Choose File and pick an image. JPG, PNG, WebP, GIF, or anything else your browser can display will work.
  2. Move the Quality slider. It runs from 10 to 100 in steps of 5, and starts at 70.
  3. Click Convert and look closely at the preview, especially edges, text and smooth gradients like skies.
  4. Click Download to save compressed.jpg. If you don't like the result, change the slider and click Convert again.

The tool doesn't show the before and after file sizes, so compare them in your file manager after downloading.

How the quality setting works

The slider value is divided by 100 and passed to the browser's canvas.toDataURL('image/jpeg', quality), so 70 on the slider means a quality of 0.7. The browser's own JPEG encoder does the work, which means the exact file size for a given setting can differ slightly between Chrome, Firefox and Safari.

Slider What to expect
90–100 Very close to the original. Larger files; 100 can be bigger than the source.
70–85 A common range for photos on the web. Artifacts are hard to spot at normal viewing size.
40–65 Noticeably smaller. Blockiness may appear in skies, gradients and around text.
10–35 Visible blocks and color banding. Fine for tiny thumbnails or rough previews.

These are general tendencies, not guarantees. How much a file shrinks depends on the image: a detailed photo of foliage compresses very differently from a portrait against a plain wall.

Worked example

You have a 4000 × 3000 photo from a phone and a website that rejects uploads over a size limit.

  1. Compress at 70 and download. The result is still 4000 × 3000 pixels, only re-encoded.
  2. If it's still too big, resizing helps far more than lowering quality further. Halving each side to 2000 × 1500 in the image resizer leaves a quarter of the pixels to store.
  3. The resizer exports PNG, so run the resized image back through this compressor to get a JPEG again.

That order (resize, then compress) is the most effective way to get a camera photo down to web size with this site's tools.

What gets lost, besides detail

  • Transparency. JPEG has no alpha channel. The HTML standard has the browser composite the canvas onto opaque black when exporting a format without alpha, so the tool fills the canvas with white before drawing the image. Transparent pixels therefore become white, which looks right on most web pages but not on a dark background.
  • Metadata. EXIF, GPS, XMP and the embedded color profile aren't carried over, because the canvas holds only pixels. If removing metadata is the goal, the EXIF remover does the same thing at quality 0.95.
  • Animation. Only one frame of an animated GIF or WebP is kept.
  • Format. PNG, WebP and GIF inputs all become JPEG.

When JPEG isn't the right choice

JPEG suits photographs. For screenshots, logos, diagrams and anything with sharp edges or large flat areas, JPEG artifacts appear quickly and the file may not even get smaller. For those images, or anything with transparency, try the WebP converter: WebP supports transparency, and Google reports that lossy WebP files are 25–34% smaller than comparable JPEGs in its tests. Your results will vary by image.

If the image is going into an HTML or CSS file rather than being served as a file, the image to Base64 converter turns the compressed JPEG into a data URL.

Last updated

Frequently asked questions

Is my image uploaded anywhere?
No. Compression happens locally in your browser using a canvas element. The image never leaves your device.
What quality setting should I use?
Start at the default of 70 and compare the preview with the original. Photos often look fine between 60 and 80. Drop lower only if size matters more than detail, and go higher for images with fine text or sharp edges, where JPEG artifacts show up first.
Why is my compressed file bigger than the original?
The tool always re-encodes, so if the original was already a heavily compressed JPEG, or a small PNG of flat colors such as a logo or screenshot, the new JPEG can come out larger. Try a lower quality, or keep the original.
Does it change the image dimensions?
No. The output has exactly the same width and height in pixels. To cut the file size further, scale the image down first with the image resizer, then compress it.
What happens to transparent PNGs?
The output is always JPEG, which has no transparency, so the tool fills transparent areas with white. A logo on a transparent background comes out on a white rectangle. For images that need to stay transparent, convert to WebP instead.
Does compressing remove EXIF data?
Yes, as a side effect. The image is redrawn from its pixels, so camera details, GPS location and other metadata aren't copied into the compressed file.