Cropped Image
{{ outputWidth }} × {{ outputHeight }} • {{ outputSizeKB }} KB
{{ originalWidth }} × {{ originalHeight }} Source {{ savingPercent }} % Smaller {{ formatLabel }}
Source

{{ dropZoneText }}

:
{{ qualityPct }} %
Crop source
Arrows: move • +/-: zoom • [ ]: rotate • H/V: flip • E: export • R: reset view • Ctrl/⌘+V: paste image
Avatar (circle)
Original
Original
{{ originalWidth }} × {{ originalHeight }} • {{ originalSizeKB }} KB
Cropped
Cropped
{{ outputWidth }} × {{ outputHeight }} • {{ outputSizeKB }} KB
  • {{ r.label }}
    {{ r.value }}

        

Introduction:

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.

Technical Details:

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.

Core Equations:

s = max ( 0 , 1 ba ) × 100
Scale mode:   w'=ow×p/100 , h'=oh×p/100 Long‑edge mode:   r= Lmax(ow,oh) , w'=round(ow×r) , h'=round(oh×r)
Symbols and units used by the compression and resizing equations
Symbol Meaning Unit/Datatype Source
aOriginal file sizeKBMeasured from file
bCompressed file sizeKBMeasured after encode
sSaving percentage%Derived
qQuality in [0.1–1.0]UnitlessDerived from control
pScale percentage%Input
LTarget long‑edge lengthpxInput
ow, ohOriginal width, heightpxMeasured from image
w', h'Output width, heightpxDerived
targetKBDesired file sizeKBInput

Variables & Parameters:

Compression parameters, meanings, ranges, and notes
Parameter Meaning Unit/Datatype Typical Range Sensitivity Notes
FormatOutput encodingEnumJPEG | PNG | WebPHighControls compression family.
QualityCompression quality%10–100HighMapped to q in [0.1–1.0].
Retain EXIFKeep camera metadataBooleanOn/OffMediumAdds context; increases size.
Auto‑rotateHonor orientation tagBooleanOn/OffLowUprights images with tags.
Convert sizePNG→JPEG thresholdKB0–∞Medium0 disables conversion.
Resize modeDimension controlEnumNone | Fit | Scale | LongHighAspect ratio preserved.
Max width/heightFit boundspx≥ 0MediumUsed when mode=Fit.
Scale (%)Uniform scale%1–1000HighFloored to integers.
Long edgeLongest sidepx≥ 1HighShort side derived.
Target sizeDesired file sizeKB≥ 0HighApplies to JPEG/WebP.

Units, Precision & Rounding Policy:

Units and rounding used in calculations and displays
Item Policy Value/Format Notes
Decimal separatorCharacter.Standard dot notation.
Size displayPrecision2 decimalsKB shown as bytes ÷ 1024.
Percent displayPrecision1 decimalSavings and batch averages.
RoundingMethodJavaScript toFixedBrowser numeric rounding.
Log/baseN/ANo logarithms used.

Validation & Bounds Extracted from Code:

Field validation rules and limits
Field Type Min Max Step/Pattern Error Text
File inputimage/*, multipleAccepts images onlyNon‑images ignored
Qualityrange10100step 1
FormatselectJPEG | PNG | WebP
Preserve EXIFcheckboxboolean
Auto‑rotatecheckboxboolean
PNG→JPEG thresholdnumber0KB0 disables
Resize modeselectNone | Fit | Scale | Long
Max widthnumber0pxUsed when Fit
Max heightnumber0pxUsed when Fit
Scale (%)number11000step 1Used when Scale
Long edge (px)number1Used when Long
Target size (KB)number0step 1JPEG/WebP only
Batch rowstatus badgeQueued/Processing/DoneError

Worked Example:

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.

a=2100.00 KB b=480.32 KB s=max(0,1480.322100.00)×100=77.1%

The long‑edge rule yields 1600 × 1200 px, and the quality search settles near the target. Percentages display with one decimal.

Assumptions & Limitations:

  • Accepts only files with MIME types starting with image/.
  • Heads-up Target‑size tuning applies to JPEG and WebP; PNG uses single‑pass encoding.
  • Quality search runs up to seven passes and stops when within ±max(8 KB, 4%) of the target.
  • EXIF retention increases output size; disabling EXIF can reduce size and improve privacy.
  • Auto‑rotation reads orientation metadata to display images upright before encoding.
  • Displayed sizes are calculated as bytes ÷ 1024 and labeled KB.
  • ZIP packaging is generated locally; if packaging features are unavailable, batch downloads may be individual.

Edge Cases & Error Sources:

  • Very large images can exhaust memory during decoding or preview.
  • Non‑image files are ignored; unsupported clipboard content is skipped silently.
  • Corrupt images may fail to decode; affected batch rows show Error.
  • Orientation tags may alter reported dimensions after auto‑rotation.
  • Rounding in toFixed can change displayed values by 0.01 KB.
  • Setting contradictory resize values (e.g., zero bounds) effectively leaves dimensions unchanged.

Scientific/Standards Backing:

  • JPEG compression defined in ISO/IEC 10918‑1.
  • PNG format specified in ISO/IEC 15948.
  • EXIF metadata defined by JEITA CP‑3451.
  • WebP image format specification describes lossy and lossless modes.

Privacy & Compliance:

Files are processed locally in your browser; no network requests are made by the compression logic. No data is transmitted or stored server‑side.

Step‑by‑Step Guide:

Follow these quick steps to go from source images to lighter files.

  1. Add one or more images by dropping, pasting, or selecting from your device.
  2. Choose Format (JPEG, PNG, or WebP).
  3. Adjust Quality to balance size and fidelity.
  4. Pick a Resize mode and fill its fields if needed.
  5. Optionally enter a Target size in KB JPEG/WebP only.
  6. Toggle EXIF retention and auto‑rotation to suit privacy and orientation needs.
  7. Process the image(s), then download the result or a ZIP of the batch.

Example: Pick WebP, set Quality to 75, choose Long‑edge 1600 px, and enter 500 KB as Target size. Compress, preview, and download.

  • For smallest files, combine resizing with moderate quality.
  • For archival copies, keep EXIF and choose a higher quality.

You will get smaller files tailored to your delivery constraints.

FAQ:

What formats can I output?

JPEG, PNG, and WebP are available. Choose based on compatibility needs and desired compression behavior.

How accurate is the target size?

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.

Does it upload or store my files?

No. All processing happens in your browser, and no server storage or network transfer is performed by the compression logic.

Can I batch compress and get a ZIP?

Yes. Queue multiple images, run the batch, and package finished outputs into a ZIP generated on your device.

Why didn’t the preset change settings?

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.

What happens to EXIF data?

When EXIF retention is on, camera metadata like date, GPS, and lens info is kept. Turning it off can reduce size and improve privacy.

Which images can I drop or paste?

Any file recognized by the browser as an image (image/*). Non‑image items are ignored.

How are size numbers calculated?

Displayed KB values are computed as bytes divided by 1024 with two decimal places; saving percentages use one decimal place.

Is there a license notice?

No license banner is shown in the interface. Use your own images lawfully and follow your organization’s policies.

Troubleshooting:

  • Nothing happens after dropping a file: ensure it is an image type.
  • Blurry output: raise Quality or pick a less aggressive resize.
  • Orientation looks wrong: enable auto‑rotation and recompress.
  • Target size is not reached: relax the target or choose WebP/JPEG.
  • ZIP does not download: download items individually as a fallback.

Advanced Tips:

  • Tip Use Long‑edge for responsive media; it preserves aspect ratio with predictable bounds.
  • Tip Combine a moderate quality with EXIF stripping for strong size reductions.
  • Tip Set a PNG→JPEG threshold when screenshots or UI art inflate in PNG.
  • Tip Keep batch settings consistent to compare savings across a set.
  • Tip Use Fit mode with square bounds to constrain either dimension without cropping.

Glossary:

Image compression
Reducing file size while maintaining acceptable visual quality.
EXIF
Exchangeable Image File Format metadata stored in images.
Quality (q)
Numeric control mapped to 0.1–1.0 for encoders.
Long edge (L)
Target length of the longest image side in pixels.
Saving (s)
Percentage reduction from original to compressed size.
Target size
Desired output size in kilobytes used for quality search.