Image compressor (JPEG/PNG/WebP)
Re-encode a photo or screenshot with tuned quality settings to reduce file size while keeping edges and text readable. Ideal for blog images, email attachments, and platform avatars.
The tool keeps the original format where possible. For example, JPEG remains JPEG; PNG remains PNG. Size reduction is strongest on JPEG photos.
How this browser-based image compressor works
The compressor uses the HTML canvas element as a lightweight image lab. When
you select a file, the script reads it with a FileReader,
constructs an Image object, and draws that image onto an
off-screen canvas at its original resolution. Once the pixels are in the
canvas, the tool can ask the browser to export them again as a JPEG, PNG or
WebP file with a particular quality level. That new encoding often stores the
same visible information in fewer bytes, especially for photographs and
gradients where some compression artefacts are acceptable.
The canvas pipeline keeps everything on the user’s side. No upload takes place; the browser only reads the local file, processes it in memory, and generates a blob representing the compressed image. This blob is handed to a temporary download link, which is then triggered programmatically so the output appears in your downloads folder without additional interaction. The original file stays on your machine untouched, which is important when dealing with photos that you might want to edit again in the future.
Understanding the compression profiles
The “Balanced” profile targets common web usage: article thumbnails, gallery images, and cover photos. Internally it maps to a medium-high JPEG quality factor, which keeps edges clean while discarding subtle noise and invisible colour variations. The exact quality value is chosen so most modern displays will not reveal artefacts at normal viewing distances, yet the file size shrinks significantly compared to a camera-original JPEG.
The “Soft compression” profile uses a slightly higher quality factor. This is appropriate when the image contains fine text, interface screenshots, or technical diagrams where crispness matters more than aggressive size reduction. Even in that mode, the canvas re-encoding often removes redundant detail from uniform areas such as flat backgrounds or gradients.
The “Strong compression” profile is intended for situations where the primary goal is small file size and minor artefacts are acceptable: preview images for messaging apps, quick mock-ups, or background pictures in presentations. The visual result remains usable, but close inspection will reveal slightly softer edges and more visible block patterns in uniform regions. For important assets such as portfolio work or product photos, it is safer to stay with the balanced or soft profiles.
Why JPEG shrinks more than PNG
The tool preserves the original format in order to avoid breaking transparency or introducing unexpected behaviour. That means JPEG uploads stay JPEG and PNG uploads stay PNG. In practice, this leads to different results: JPEG files often shrink dramatically because the lossy compression scheme can discard decoded detail, while PNG compression is lossless and mainly optimises how pixel patterns are stored. A scanned logo with sharp edges and transparency might only shrink a little as PNG, even after re-encoding, which is expected.
When you need strong reduction and do not rely on transparency, it can be more effective to convert a PNG to JPEG on purpose using the format-conversion tool on this page. That change does sacrifice lossless reproduction, but it mirrors how most websites already handle photographic content and banners, and it keeps download sizes under control.
Practical tips for everyday use
A simple workflow is to keep a high-quality version of an image in a personal archive and generate publication versions using this compressor. Use the soft profile for diagrams and screenshots, balanced for general web images, and strong for supporting visuals that do not require close inspection. After each run, check the compressed file in an image viewer at the size it will appear online. If artefacts stand out, step back to a gentler profile and re-run the process.