Image compression reduces the bytes needed to store a picture while keeping the scene looking the same to the eye. Also called image optimization, it balances format and quality with size so files move faster and occupy less storage. Many workflows include exchangeable image file format (EXIF) data for context, and you can compress images without losing visible quality when publishing or sharing.
You choose an image, pick an output format, and tune quality or resizing to set the trade‑off. The output is a new file that is smaller yet visually faithful. Standards like JPEG (ISO/IEC 10918‑1) and PNG, and the newer WebP, differ in compression behavior and guide choices about delivery and display.
Imagine a high‑resolution holiday photo. Trimming the long edge and using a moderate quality setting can drop size dramatically while preserving detail for screens. Push too far and you may introduce banding or blockiness, so keep an original copy before aggressive changes.
The utility runs entirely in the browser using a client‑side compressor engine. Inputs include output format (JPEG, PNG, WebP), quality (percent), optional resizing controls, EXIF retention, auto‑rotation from orientation tags, a PNG‑to‑JPEG conversion threshold, and an optional target file size. When a target size is set with JPEG or WebP, the engine iteratively adjusts quality using a bounded search to approach the target within a small tolerance. Batch mode processes items sequentially and can package finished files into a ZIP archive.
Symbol | Meaning | Unit/Datatype | Source |
---|---|---|---|
a | Original file size | KB | Measured from file |
b | Compressed file size | KB | Measured after encode |
s | Saving percentage | % | Derived |
q | Quality in [0.1–1.0] | Unitless | Derived from control |
p | Scale percentage | % | Input |
L | Target long‑edge length | px | Input |
ow, oh | Original width, height | px | Measured from image |
w', h' | Output width, height | px | Derived |
targetKB | Desired file size | KB | Input |
Parameter | Meaning | Unit/Datatype | Typical Range | Sensitivity | Notes |
---|---|---|---|---|---|
Format | Output encoding | Enum | JPEG | PNG | WebP | High | Controls compression family. |
Quality | Compression quality | % | 10–100 | High | Mapped to q in [0.1–1.0]. |
Retain EXIF | Keep camera metadata | Boolean | On/Off | Medium | Adds context; increases size. |
Auto‑rotate | Honor orientation tag | Boolean | On/Off | Low | Uprights images with tags. |
Convert size | PNG→JPEG threshold | KB | 0–∞ | Medium | 0 disables conversion. |
Resize mode | Dimension control | Enum | None | Fit | Scale | Long | High | Aspect ratio preserved. |
Max width/height | Fit bounds | px | ≥ 0 | Medium | Used when mode=Fit. |
Scale (%) | Uniform scale | % | 1–1000 | High | Floored to integers. |
Long edge | Longest side | px | ≥ 1 | High | Short side derived. |
Target size | Desired file size | KB | ≥ 0 | High | Applies to JPEG/WebP. |
Item | Policy | Value/Format | Notes |
---|---|---|---|
Decimal separator | Character | . | Standard dot notation. |
Size display | Precision | 2 decimals | KB shown as bytes ÷ 1024. |
Percent display | Precision | 1 decimal | Savings and batch averages. |
Rounding | Method | JavaScript toFixed | Browser numeric rounding. |
Log/base | N/A | — | No logarithms used. |
Field | Type | Min | Max | Step/Pattern | Error Text |
---|---|---|---|---|---|
File input | image/*, multiple | — | — | Accepts images only | Non‑images ignored |
Quality | range | 10 | 100 | step 1 | — |
Format | select | — | — | JPEG | PNG | WebP | — |
Preserve EXIF | checkbox | — | — | boolean | — |
Auto‑rotate | checkbox | — | — | boolean | — |
PNG→JPEG threshold | number | 0 | ∞ | KB | 0 disables |
Resize mode | select | — | — | None | Fit | Scale | Long | — |
Max width | number | 0 | ∞ | px | Used when Fit |
Max height | number | 0 | ∞ | px | Used when Fit |
Scale (%) | number | 1 | 1000 | step 1 | Used when Scale |
Long edge (px) | number | 1 | ∞ | — | Used when Long |
Target size (KB) | number | 0 | ∞ | step 1 | JPEG/WebP only |
Batch row | status badge | — | — | Queued/Processing/Done | Error |
Inputs: JPEG format, Quality 75%, Long‑edge 1600 px, Target size 500 KB. Suppose the original image is 2100.00 KB with dimensions 4032 × 3024.
The long‑edge rule yields 1600 × 1200 px, and the quality search settles near the target. Percentages display with one decimal.
image/
.toFixed
can change displayed values by 0.01 KB.Files are processed locally in your browser; no network requests are made by the compression logic. No data is transmitted or stored server‑side.
Follow these quick steps to go from source images to lighter files.
Example: Pick WebP, set Quality to 75, choose Long‑edge 1600 px, and enter 500 KB as Target size. Compress, preview, and download.
You will get smaller files tailored to your delivery constraints.
JPEG, PNG, and WebP are available. Choose based on compatibility needs and desired compression behavior.
For JPEG and WebP, the engine iterates up to seven passes and accepts results within ±max(8 KB, 4%) of the target. PNG ignores the target and encodes once.
No. All processing happens in your browser, and no server storage or network transfer is performed by the compression logic.
Yes. Queue multiple images, run the batch, and package finished outputs into a ZIP generated on your device.
A preset selector is present, but in this build it is not wired to update the other controls automatically. Adjust parameters directly to match the label you want.
When EXIF retention is on, camera metadata like date, GPS, and lens info is kept. Turning it off can reduce size and improve privacy.
Any file recognized by the browser as an image (image/*
). Non‑image items are ignored.
Displayed KB values are computed as bytes divided by 1024 with two decimal places; saving percentages use one decimal place.
No license banner is shown in the interface. Use your own images lawfully and follow your organization’s policies.