Image Compressor
Compress an image in your browser, resize or reformat it, compare size and quality changes, and strip supported EXIF before download.Compression Receipt
Current status
| Metric | Value | Copy |
|---|---|---|
| {{ r.label }} | {{ r.value }} | |
| Add an image to see details. | ||
| Check | Status | Detail | Copy |
|---|---|---|---|
| {{ r.check }} | {{ r.status }} | {{ r.detail }} |
Introduction:
A photograph can look ordinary on screen and still carry more pixels, format overhead, and camera metadata than the next upload needs. A 12-megapixel phone image may be harmless in a photo library but awkward in an email thread, product form, chat message, or content management system with a strict size cap. Image compression is the set of choices that turns that large raster file into a delivery copy without losing the detail, shape, transparency, or privacy properties that still matter.
Raster images are built from pixels. File size is affected first by how many pixels must be stored, then by the format and compression method used to describe them. Reducing a 4000 x 3000 photo to a 1600-pixel long edge removes far more data than nudging a quality slider from 85 to 80, because both width and height shrink together. Format choice decides the next tradeoff: JPEG and lossy WebP can discard visual detail to save bytes, while PNG keeps exact pixel values and often stays larger for photos.
| Use case | What normally matters | Mistake to avoid |
|---|---|---|
| Photo for web or email | Byte savings, upright orientation, and acceptable face or product detail | Keeping full camera resolution when the destination displays a much smaller image |
| Screenshot or interface crop | Sharp text, clean edges, and readable small icons | Using heavy lossy compression until letters blur or color bands appear |
| Logo or transparent artwork | Alpha transparency, crisp boundaries, and exact colors | Flattening transparency to JPEG without choosing a suitable background color |
| Public sharing | Smaller size plus reduced camera and location-like metadata exposure | Leaving EXIF data in a copy that no longer needs camera context |
Quality numbers are not universal. A JPEG quality value and a WebP quality value do not promise the same visual result, and the same value can look different across photos, screenshots, gradients, and artwork. A busy outdoor photo may hide compression marks well, while flat backgrounds and text can reveal artifacts quickly. The useful test is the final image at the size where people will see it.
Metadata deserves its own decision. Exchangeable Image File Format (EXIF) data can include camera settings, timestamps, orientation, device information, thumbnails, and sometimes GPS-like details. Removing supported EXIF is a good default for casual sharing, while keeping it can be useful for a photo archive, legal record, or editing handoff.
A well-compressed image is not simply the smallest possible file. It is the smallest copy that still matches the destination: enough pixels for the display size, a format that preserves required features, quality high enough for the subject, and metadata treatment that fits the privacy risk.
How to Use This Tool:
Use this workflow when you need one smaller browser-readable image and a visible receipt of the size, pixel, format, and metadata changes.
- Add one file in
Source imageby browsing, dropping, or pasting. The file can be PNG, JPEG, WebP, GIF, BMP, or another image type the browser can read. The summary should show the source size and dimensions after the file loads. - Choose a
Compression presetif you want a practical starting point.Balanced web imageis the general web default,Privacy-safe sharereduces dimensions and strips supported EXIF,Tiny upload assetaims for a strict KB budget, andHigh-fidelity archive copykeeps more detail and supported EXIF. - Set
Output formatbefore tuning quality. Use WebP for compact web delivery, JPEG for broad photo compatibility, or PNG when lossless pixels and transparency are more important than quality-slider control. - Set
Resize modewhen the source has more pixels than the destination needs.Fit to width and heightkeeps the image inside a maximum box,Scale by percentchanges both dimensions proportionally, andSet long edgederives the shorter side from the original aspect ratio. - Adjust
Qualityfor JPEG or WebP, or enter aTarget sizein KB when a portal or message cap is fixed. When PNG is selected, the quality and target-size search are ignored, so resize and source content become the main size controls. - Check the advanced choices only when they matter. Use
JPEG backgroundbefore flattening transparent artwork, leaveFix orientationon for most phone images, keepKeep EXIFoff for ordinary sharing, and useConvert thresholdwhen large source files should be re-encoded instead of copied through. - Review
Compression Receipt,Optimized Image,Compression Metrics,Savings Breakdown, andOptimization Notes. IfUnable to compress this imageappears, try a smaller source, a different output format, or a source file the browser can decode cleanly.
Download the result only after the preview, Compressed Size, Compressed Dimensions, Output Type, Target Size, and metadata note match the image's next use.
Interpreting Results:
Read size, dimensions, format, and preview together. Compressed Size shows the byte result, Compressed Dimensions shows whether enough pixels remain, Output Type confirms the browser's actual encoded format, and Size Change tells you whether the output is smaller or larger than the source.
Target metmeans the final file is less than or equal to the requested KB budget.Best effort missedmeans the search could not reach the budget with the selected format, resize, and quality range.Metadata strippedmeans supported EXIF was removed during re-encoding.EXIF keptcan preserve useful camera context, but it can also retain device or location-like information from the source.Strong,Moderate,Small, andLargerdescribe byte change only. A strong byte reduction can still be unacceptable if faces, product edges, gradients, or small text look damaged.Browser output: Fallbackmeans the browser returned a different image type than requested. CheckOutput Typebefore using the file in a system that expects a specific format.- A GIF source may become a single still frame after browser canvas compression. Do not use the output as a replacement for animation unless a still image is acceptable.
Use Compare split as the final confidence check. Move it across faces, text, transparent edges, flat backgrounds, and fine details before deciding that the smaller file is good enough.
Technical Details:
Image bytes fall when either fewer pixels are encoded or each pixel is described with fewer bits. Resizing changes the first part directly. A 50% scale on both width and height leaves about 25% of the original pixel count, before any format compression is applied.
Lossy encoding changes the second part by approximating the image. JPEG is photo-oriented and has no alpha channel, so transparent pixels are drawn over the selected background color before export. WebP can support lossy compression and transparency when the browser output path supports it. PNG is treated as lossless in this workflow, so it preserves exact pixels and ignores the lossy quality and target-size search.
Orientation and metadata are separate from visual compression. Some camera files store rotation as EXIF rather than as already-rotated pixels. Applying orientation before encoding keeps portrait images upright, while stripping supported EXIF reduces metadata exposure and may remove a small amount of byte weight.
Formula Core:
The displayed size change compares the original byte count with the compressed byte count. Positive values mean the output is smaller; negative values mean the output grew.
For a 4.80 MB source and a 1.20 MB output, the calculation is (1 - 1.20 / 4.80) x 100, so the result is 75.0% smaller. If a 220 KB source becomes a 260 KB output, the same formula returns a negative value and the result is reported as larger.
Transformation Core:
The processing path is decode, optional orientation correction, resize, format conversion, optional target-size search, then byte and dimension comparison. The target search is deliberately best-effort because image content, browser encoder behavior, and format support vary.
| Requested format | Encoding behavior | Quality control | Target-size search | Transparency behavior |
|---|---|---|---|---|
| JPEG | Lossy photo-oriented encoding | Used from 1% to 100%, internally bounded to 0.10 to 1.00 for encoding | Used when Target size is above 0 |
Flattened against JPEG background |
| WebP | Lossy browser encoding in this workflow | Used from 1% to 100%, internally bounded to 0.10 to 1.00 for encoding | Used when Target size is above 0 |
Can preserve transparency when the browser supports the output path |
| PNG | Lossless output path | Ignored | Ignored | Preserved |
For JPEG and WebP targets, the quality search starts from the selected quality and can test up to eight candidates between 25% and 100% quality. It can stop early when the file is within 8 KB of the requested budget or within 4% of that budget, whichever tolerance is larger. The result still counts as met only when Compressed Size is less than or equal to Target size.
| Rule | How it works | What to verify |
|---|---|---|
None |
Keep the source width and height. | Pixel Change should report that dimensions were kept. |
Fit to width and height |
Apply maximum width and maximum height constraints without stretching. | Compressed Dimensions should fit inside both limits. |
Scale by percent |
Multiply width and height by the same percentage, using whole-pixel output dimensions. | Pixel Change should reflect the proportional pixel-count change. |
Set long edge |
Set the longer side to the requested pixels and derive the shorter side from the aspect ratio. | The larger value in Compressed Dimensions should match the requested long edge. |
| Compression result | Boundary | Meaning |
|---|---|---|
Strong |
Size Change is at least 40.0% smaller. |
Useful byte reduction, still requiring visual inspection. |
Moderate |
Size Change is at least 10.0% and below 40.0% smaller. |
A practical reduction, often improved by resizing or lowering quality. |
Small |
Size Change is 0.0% to below 10.0% smaller. |
The source may already be compact or the settings preserve detail. |
Larger |
Size Change is below 0.0%. |
The selected output is larger than the source; change format, resize, or keep the original. |
Privacy Notes:
The selected image is read and re-encoded in the browser. The image file is not sent to a compression service by this workflow, but supporting browser runtimes for compression, charts, and document exports may load from public script hosts. Use an approved local editor for confidential images that must not depend on external script loading.
- Leave
Keep EXIFoff when camera details, capture times, thumbnails, or location-like data should not travel with the delivery copy. - Metadata removal is limited to what the browser re-encoding path and supported EXIF handling can strip. Treat highly sensitive images as needing a dedicated metadata audit.
- The preview object URL is temporary browser data for the current session. Downloaded files are controlled by the browser and operating system after saving.
Worked Examples:
These cases show how the visible receipt and notes should drive the final decision, not just the byte count.
Phone photo for a profile form
A 4032 x 3024 JPEG is too large for a profile upload that accepts about 400 KB. Choose Privacy-safe share, keep WebP, and leave Keep EXIF off. If Target Size says met and Compressed Dimensions still gives enough pixels for the profile crop, move Compare split across the face and background before downloading.
Transparent logo headed to a white page
A PNG logo with transparency may stay large when kept lossless. If JPEG is acceptable for the destination, set JPEG background to the page color before converting. If the edge looks haloed in Optimized Image, switch back to PNG or WebP so transparency is preserved.
Target missed after quality search
A screenshot with small text can miss a 150 KB target even after the quality search. When Target Size reports missed, reduce dimensions with Set long edge or Fit to width and height rather than forcing very low quality. The output is ready only when the target result and small text both pass inspection.
FAQ:
Why did the compressed image get larger?
The source may already be well compressed, or the selected format may add bytes for the content. Check Size Change, then try WebP or JPEG, reduce dimensions, or keep the original when the output is marked Larger.
Why is target size ignored for PNG?
PNG output is lossless here, so the JPEG/WebP quality search does not apply. Use resize controls, change to WebP or JPEG, or accept that exact pixels and transparency may require a larger file.
Does stripping EXIF remove every hidden detail?
It removes supported EXIF during browser re-encoding when Keep EXIF is off, but no browser compression workflow should be treated as a complete forensic metadata scrub. Use a dedicated metadata tool for sensitive releases.
Why did my GIF stop animating?
Browser canvas compression commonly exports a still image from an animated GIF source. If animation matters, keep the original GIF or use an animation-aware workflow.
What should I check before downloading?
Check Compressed Size, Compressed Dimensions, Output Type, target status, metadata status, and the split preview. The file is ready only when both the numbers and the visible image fit the destination.
Glossary:
- Raster image
- An image stored as a grid of pixels, such as a photo, screenshot, PNG, JPEG, or WebP file.
- Lossy compression
- Compression that saves bytes by approximating image detail instead of preserving every pixel exactly.
- Lossless compression
- Compression that preserves exact pixel values, often at a larger size for photos.
- Alpha transparency
- Pixel transparency that lets artwork sit over another background without a solid rectangle.
- EXIF
- Image metadata that can store camera settings, timestamps, orientation, device details, and sometimes location-like information.
- Target size
- A requested KB budget used for best-effort JPEG or WebP quality search.
References:
- HTMLCanvasElement: toBlob() method, MDN Web Docs, February 12, 2026.
- An image format for the Web, Google for Developers, August 7, 2025.
- ExifTool by Phil Harvey, ExifTool.
- CanvasRenderingContext2D, MDN Web Docs, April 25, 2026.