Image Compressor — Compress WebP, AVIF, PNG & JPEG Online

Image Compressor

Compress and optimize images to reduce file size without noticeable quality loss.

Free online image compressor that reduces raster photo and graphic file sizes while preserving visual fidelity. Supports WebP, AVIF, PNG, JPEG, GIF, BMP, and TIFF input formats with intelligent multi-format output encoding in WebP, AVIF, PNG, and JPEG. Features MozJPEG trellis quantization, WebP VP8/VP8L optimization, AV1 block partitioning, and PNG Deflate compression. Includes target file size budgeting (KB/MB), proportional dimension resizing, attention-based AI smart cropping, and automated EXIF metadata stripping. Batch process up to 20 images simultaneously with side-by-side comparison previews and ZIP archive export.

Keywords: image compressor, compress image, compress photo, optimize image, reduce image size, photo compressor, png compressor, jpeg compressor, webp compressor, avif converter, image optimizer, batch compress images, smart crop, ai crop, strip exif, compress image to target size

Tags: image, compress, optimize, resize, crop, photo, png, jpeg, webp, avif, batch, performance

Image Compressor is also known as: Online Image Compressor, WebP Compressor, AVIF Compressor, PNG Compressor, JPEG Compressor, Photo Size Reducer, Batch Image Compressor, Lossless Image Optimizer, Target Size Image Reducer, EXIF Metadata Stripper, Smart Crop Image Optimizer, Core Web Vitals Image Reducer.

How to Image Compressor Online

  1. Upload raster graphics: Drag and drop or browse to select up to 20 files. Supported input formats include WebP, AVIF, PNG, JPEG, GIF, BMP, and TIFF up to 20MB per image.

  2. Select target encoding format: Choose WebP for modern web deployment (~30% smaller than JPEG), AVIF for next-gen ultra-high compression (~50% smaller), PNG for lossless 32-bit RGBA graphics, or JPEG for universal legacy compatibility.

  3. Configure quality or target size: Adjust the fine-grained quality slider (1–100%) or enter a target file size in kilobytes (KB). The engine performs multi-pass binary search quality optimization to meet your exact byte budget.

  4. Apply geometry & cropping transforms: Scale width and height dimensions with aspect ratio lock, or activate AI attention-based smart cropping to automatically center and crop the visual focal point.

  5. Toggle metadata stripping: Enable EXIF stripping to automatically erase embedded GPS coordinates, camera serial numbers, exposure timestamps, and ICC color profile bloat for maximum privacy and byte savings.

  6. Inspect live savings and export: Use the interactive before/after split viewer to verify visual fidelity and inspect byte reduction percentages. Download individual optimized files or export the complete batch as a single ZIP archive.

Image Compressor Features

  • Multi-Format Optimization Engine: Lossy and lossless compression pipelines for WebP, AVIF, PNG, and JPEG powered by high-performance libvips and sharp native codecs.

  • Next-Gen AVIF & WebP Encoding: Achieve up to 85% byte reduction compared to uncompressed source imagery, dramatically boosting Google Core Web Vitals (Largest Contentful Paint).

  • MozJPEG Trellis Quantization: Leverages advanced MozJPEG trellis rate-distortion optimization and custom quantization tables for superior JPEG fidelity at low bitrates.

  • Target File Size Budgeting: Specify exact maximum file size thresholds in KB. The optimizer iteratively calculates optimal quantization parameters to meet your performance budgets.

  • Batch Processing Pipeline: Concurrently compress up to 20 images with per-asset progress indicators, individual format overrides, and one-click batch ZIP archiving.

  • Automated Privacy & EXIF Stripping: Purges sensitive location tags, camera metadata, creator information, and thumbnail previews to protect privacy and eliminate hidden payload weight.

  • Attention-Based AI Smart Cropping: Utilizes luminance and edge saliency attention models to automatically frame subjects when downsampling to social media and banner aspect ratios.

  • Lossless PNG Palette Reduction: Automatically switches between 24-bit RGB, 32-bit RGBA, and adaptive 8-bit color palettes (PNG8) with Floyd-Steinberg dithering when downscaling UI screenshots.

  • Chroma Subsampling Control: Automatically switches between 4:2:0 subsampling for photographs and 4:4:4 full-color resolution for high-contrast UI graphics and typography.

  • Anti-Inflation Protection: Automatically inspects output buffer dimensions and byte sizes to prevent already-optimized source images from inflating during re-encoding.

  • Interactive Split-Screen Viewer: Inspect real-time visual structural similarity (SSIM) and pixel differences before exporting production assets.

  • Zero Telemetry & Strict Privacy: Processed assets are compressed ephemerally in isolated sandboxes and never retained, trained on, or shared with third parties.

Supported Formats & Dialects

The Image Compressor supports 6 syntax formats and dialects for accurate parsing and processing.

WebP Compression (Google VP8 / VP8L)
Combines VP8 keyframe intra-frame prediction with VP8L spatial transform entropy coding. Provides configurable effort levels (effort 6), smart chroma subsampling, and 8-bit alpha transparency with 98%+ global browser support.
AVIF Next-Gen Compression (AOMedia AV1)
Next-generation ISO/IEC 23000-22 codec utilizing directional spatial prediction across 56 angular modes, recursive 128x128 to 4x4 partitioning, and in-loop Wiener restoration filters for 50%+ byte savings over legacy JPEG.
MozJPEG Trellis Quantization (ISO/IEC 10918-1)
Enhanced JPEG encoder implementing rate-distortion trellis quantization, progressive scan optimization, and adaptive luminance/chrominance quantization matrices for maximum backward-compatible web compression.
PNG Adaptive Filtering & Deflate (W3C RFC 2083)
Lossless raster pipeline applying 2D adaptive filtering (Paeth, Sub, Up, Average) followed by zlib DEFLATE level-9 compression and optional color-quantized 8-bit palette mapping.
Target KB Budgeting (Multi-Pass Binary Search)
Iterative rate-control algorithm that bounds output file sizes within specified kilobyte thresholds by executing multi-pass quantization searches without exceeding target latency constraints.
Attention Saliency & Geometry Transforms
Intelligent crop and resize pipeline that extracts high-frequency visual regions (sharp attention strategy) to maintain visual hierarchy across responsive display breakpoints.
All Guides
All Standards

Frequently Asked Questions

How does MozJPEG trellis quantization reduce JPEG file size without perceptible quality loss?
MozJPEG incorporates trellis quantization, an algorithm derived from information theory and video coding. During the discrete cosine transform (DCT) stage, standard JPEG encoders round high-frequency frequency coefficients to fixed quantization table steps. MozJPEG models quantization as a rate-distortion optimization problem, testing candidate coefficient values against a Lagrangian cost function ($J = D + \lambda R$) that balances visual distortion ($D$) against the bit cost ($R$). By zeroing out unnoticeable high-frequency coefficients that cost excessive bits to encode, MozJPEG achieves 10–15% smaller file sizes than standard libjpeg at identical visual quality.
What are the structural similarity (SSIM) and compression efficiency differences between WebP and AVIF?
AVIF (based on the AV1 video codec) consistently outperforms WebP (based on VP8) across objective visual metrics including Structural Similarity Index (SSIM), Multi-Scale SSIM (MS-SSIM), and VMAF. On complex photographic imagery, AVIF achieves equivalent perceptual fidelity at 20–30% lower bitrates than WebP and 50% lower than legacy JPEG. Furthermore, AVIF avoids the blocky macroblock artifacts characteristic of JPEG and WebP at low bitrates (< 0.5 bits per pixel), degrading into smooth, natural gradients. However, WebP encodes approximately 5x to 10x faster than AVIF and requires less client CPU power during decoding.
How does lossy PNG palette quantization differ from lossless PNG filtering and Deflate?
Standard PNG compression is strictly lossless: it applies five 2D prediction filters (None, Sub, Up, Average, Paeth) across image scanlines to reduce entropy, then compresses the resulting byte stream with zlib DEFLATE. When compressing PNGs for web interfaces, lossy palette quantization (similar to pngquant) reduces the 24-bit RGB (16.7 million colors) color space down to an adaptive 8-bit palette of 256 optimal colors using median-cut or k-means clustering algorithms with Floyd-Steinberg error diffusion dithering. This reduces raw pixel memory from 4 bytes per pixel (RGBA) to 1 byte per pixel (index + alpha), slashing file size by 65–80% while retaining crisp UI edges.
How does target size budgeting (targetSizeKB) work during compression?
When a maximum target size (such as 150 KB) is specified, the compression engine bypasses static quality numbers and initiates a binary search rate-control loop. It sets initial lower and upper quality bounds (typically $Q_{\text{min}} = 10$ and $Q_{\text{max}} = 100$), encodes a candidate buffer at the midpoint quality, and measures the resulting byte length against the target constraint. If the buffer exceeds the budget, the upper bound drops; if it fits comfortably under budget, the lower bound increases to maximize visual fidelity. The loop converges in 3–4 passes to produce the sharpest possible image that adheres strictly to your byte budget.
How does chroma subsampling (4:2:0 vs 4:4:4) impact file size and edge clarity in compressed images?
Chroma subsampling separates luminance ($Y$, brightness) from chrominance ($Cb/Cr$, color details). Because human vision is far more sensitive to luminance variations than color variations, 4:2:0 subsampling halves horizontal and vertical color resolution, discarding 75% of raw color information to achieve immediate ~50% byte savings on photographs. However, on UI screenshots, terminal output, and diagrams containing saturated red or blue text on contrasting backgrounds, 4:2:0 causes visible color bleeding and fringing. The optimizer automatically retains 4:4:4 subsampling at high quality thresholds ($\ge 90$) to preserve pristine text sharpness while switching to 4:2:0 at standard web presets for maximum compression.
What metadata is removed during automated EXIF, XMP, and IPTC stripping?
Raw camera and smartphone photos embed substantial metadata headers that add 10 KB to 100 KB of payload overhead per asset. Enabling metadata stripping completely purges: (1) EXIF tags containing GPS coordinates, device serial numbers, firmware versions, shutter speeds, and exposure dates; (2) embedded thumbnail previews generated by camera hardware; (3) IPTC editorial and copyright schemas; and (4) XMP XML property packages created by Adobe Lightroom or Photoshop. Stripping these chunks guarantees user privacy and prevents unnecessary bandwidth consumption.
How does attention-based smart cropping detect the visual focal point of an image?
Standard geometric cropping clips images from the top-left or center, often cutting off heads, products, or important UI elements when switching aspect ratios (such as $16:9$ to $1:1$ square avatars). The attention-based smart crop algorithm performs spatial saliency analysis across the image luminance channel. It computes edge density, color variance, and visual contrast gradients to locate regions of high visual interest, then aligns the crop viewport bounding box around the identified center of attention without requiring cloud AI roundtrips.
Why does compressing an already optimized image sometimes inflate file size, and how is it prevented?
Re-compressing an image that has already been quantized at a low quality setting (e.g. JPEG Q60) through an encoder set to a higher quality setting (e.g. WebP Q85) forces the new encoder to treat the existing block artifacts and ringing noise as genuine image detail. Quantizing those artifacts consumes more bits than the original file, causing file inflation. The optimizer implements an intelligent anti-inflation guard: if the output buffer is larger than the input and no dimensional transforms (resize/crop) were applied, it preserves the original asset and returns a 0% savings indicator.
How does image compression directly improve Core Web Vitals (Largest Contentful Paint - LCP)?
On modern websites, the Largest Contentful Paint (LCP) candidate element is almost always a hero image, carousel banner, or product photo. High-resolution uncompressed assets (1.5 MB–5 MB) bottleneck the browser network download queue on mobile 4G/5G connections, delaying LCP past Google’s 2.5-second "Good" threshold. Compressing assets into AVIF or WebP under 150 KB accelerates resource load times by 80–90%, directly reducing LCP into the green zone (< 1.8s) and boosting organic search rankings.
How do lossy and lossless modes in WebP and AVIF handle 8-bit and 10-bit alpha transparency channels?
Unlike legacy JPEG (which has zero support for transparency and forces opaque backgrounds), both WebP and AVIF natively support transparency channels. WebP stores an 8-bit alpha channel compressed via lossless VP8L entropy coding even when the color channels are lossily compressed with VP8. AVIF supports independent auxiliary alpha planes at 8-bit, 10-bit, or 12-bit depths compressed using the AV1 transform pipeline. This allows web developers to display complex transparent cutouts, glowing drop shadows, and soft gradients with zero edge fringing at a fraction of traditional PNG file sizes.

Developer Reference & Learning Hubs