# How to Compress JPG, PNG, and WebP Without Losing Clarity: Format Mechanics, Transparency & Troubleshooting

Why do JPG photos shrink dramatically while PNG photos barely budge, or WebP files say 'Already optimal'? Learn how docsmall's browser-local compression handles JPG re-encoding, PNG palette quantization, and transparent WebP—plus level selection, original filenames, and 7 troubleshooting fixes.

- **Author**: docsmall Team
- **Published**: 2026-12-06
- **Tags**: Image Compression, Compress JPG, Compress PNG, Compress WebP

[Back to all articles](https://docsmall.com/en/blog) · [llms.txt](https://docsmall.com/llms.txt) · [sitemap.xml](https://docsmall.com/sitemap.xml)

---

Drop a mixed batch of images into a compressor and you will often see three puzzling outcomes: camera JPGs drop by more than half right away, desktop screenshots or photos saved as PNG stubbornly remain several megabytes, and WebP images saved from websites immediately come back as "Already optimal." Push a file all the way to Extreme to squeeze under 200 KB, and suddenly small text turns fuzzy and smooth gradients break into blocky bands.

Those differences are not random tool quirks—they happen because **JPG, PNG, and WebP use fundamentally different compression mechanics**. Treating lossy photo re-encoding, lossless indexed-palette quantization, and modern web-format recompression as if they behaved identically leads to wrong levels, mismatched formats, and avoidable quality loss.

Based on the actual browser-local implementation behind docsmall, this guide explains how JPG, PNG, and WebP compression work under the hood, what each of the four compression levels maps to, how transparency and animation behave, when to resize or convert first, and how to fix 7 common issues.

> **Quick takeaway:** docsmall's [Compress Image](/en/image-compress) and its three dedicated format pages ([Compress JPG](/en/compress-jpg), [Compress PNG](/en/compress-png), and [Compress WebP](/en/compress-webp)) share one browser-local engine: up to 30 static images per batch, 25 MB per file, zero dimension changes, and no server uploads. JPG and WebP re-encode at four quality levels (85% / 75% / 50% / 20%), while PNG reduces palette colors (256 / 128 / 64 / 32) with full Alpha transparency preserved. Any file that would not shrink is kept untouched as "Already optimal."

## Under the Hood: What Actually Happens to JPG, PNG, and WebP

When you start compression in docsmall, your browser routes each image down one of two distinct local encoding paths depending on its file type. Understanding those two paths immediately explains why some files drop dramatically while others resist further shrinking.

| Format | Best-Fit Visual Content | docsmall Local Compression Engine | Alpha Transparency | Four Levels (Slight / Normal / Strong / Extreme) | Dimensions & Metadata |
| --- | --- | --- | --- | --- | --- |
| **JPG / JPEG** | Camera photos, product shots, portraits, scans | Canvas lossy re-encoding over a `#FFFFFF` white background | Not supported (flattened to white) | Quality `0.85` / `0.75` / `0.50` / `0.20` | Same pixels; strips EXIF, GPS & ICC |
| **PNG** | Transparent logos, UI icons, text screenshots, cutouts with shadows | UPNG indexed-color palette quantization | Preserved intact | Palette `256` / `128` / `64` / `32` colors | Same pixels; strips source metadata |
| **WebP (static)** | Website graphics, blog headers, transparent modern web assets | Canvas lossy static WebP re-encoding without white fill | Preserved intact | Quality `0.85` / `0.75` / `0.50` / `0.20` | Same pixels; animated WebP outputs a single static frame |

Three practical consequences stand out from this comparison:

1. **Compression never changes pixel dimensions.** A 4032×3024 photo remains 4032×3024 after compression; only the byte representation changes.
2. **PNG shrinks by reducing distinct colors, whereas JPG and WebP shrink by lowering encoding quality.** Flat UI elements and sharp icons respond exceptionally well to palette reduction, while rich photographs stored as PNG still carry heavy lossless overhead even at 256 colors.
3. **WebP keeps transparency while JPG fills white.** Static transparent WebP graphics processed in [Compress WebP](/en/compress-webp) retain their Alpha channel instead of getting flattened onto a white canvas, making them directly usable on colored or dark web layouts.

## Choosing the Right Entry Page: All-in-One vs. Format-Specific Tools

docsmall provides both the general [Compress Image](/en/image-compress) page and dedicated format pages for [Compress JPG](/en/compress-jpg), [Compress PNG](/en/compress-png), and [Compress WebP](/en/compress-webp). All four run the exact same local Web Worker pool and accept mixed JPG/PNG/WebP batches, while tailoring guidance and visual comparisons to each format.

| Entry Page | When to Start Here | Key Focus | Local Batch Limits |
| --- | --- | --- | --- |
| [Compress Image](/en/image-compress) | Mixed batches of JPG, PNG, and WebP compressed together | Unified batch settings with side-by-side JPG and PNG visual comparisons | Up to 30 files, 25 MB each, local parallel processing |
| [Compress JPG](/en/compress-jpg) | Camera photos, e-commerce listings, ID photos, email attachments | Quality-vs-size balance, EXIF removal, and resize-first workflows | Up to 30 files, 25 MB each (also accepts PNG & WebP) |
| [Compress PNG](/en/compress-png) | Transparent logos, app icons, crisp screenshots, AI cutouts | UPNG palette behavior on gradients/shadows and when to switch to JPG | Up to 30 files, 25 MB each, keeps Alpha transparency |
| [Compress WebP](/en/compress-webp) | Blog hero images, storefront banners, Core Web Vitals (LCP) tuning | Recompressing static/transparent WebP, "Already optimal" protection, and static-frame boundary | Up to 30 files, 25 MB each, static output |

Even though one queue accepts mixed formats, **split batches when quality sensitivity differs**. For example, if half your files are gradient-heavy transparent PNGs and half are standard product JPGs, running PNGs on Slight and JPGs on Normal produces cleaner results than forcing one setting across everything.

## Picking Among the Four Compression Levels

docsmall offers **Slight, Normal, Strong, and Extreme** (with **Normal** selected by default). Matching the level to the destination upfront saves repeated trial and error.

| Level | JPG / WebP Quality | PNG Palette Colors | Best Use Cases | What to Inspect After Download |
| --- | --- | --- | --- | --- |
| **Slight** | ~`85%` | `256` colors | Photography portfolios, homepage hero banners, transparent PNGs with soft drop shadows or smooth gradients | Closest to original; may trigger "Already optimal" on already-compressed web files |
| **Normal (default)** | ~`75%` | `128` colors | Blog images, product detail pages, everyday screenshots, email or messaging attachments | Best all-around balance; start here for most batches |
| **Strong** | ~`50%` | `64` colors | Catalog thumbnails, social carousels, strict form upload caps, flat-color icons | Noticeable size drop; inspect small high-contrast text in JPGs and light gradients in PNGs |
| **Extreme** | ~`20%` | `32` colors | Low-weight preview placeholders, emergency KB caps, minimal 2–4 color line art | Maximum byte reduction; visible block artifacts appear on photos—always inspect at 100% |

One helpful workflow detail: **you can switch levels and click "Compress again" without re-adding files.** Because the browser keeps your untouched source files in memory during the session, switching from Normal to Strong always re-encodes from the original pixels—never stacking lossy recompression on top of an already compressed output.

## Why Some Images Barely Shrink or Show "Already Optimal"

Seeing "Already optimal" does not mean the tool stalled. In docsmall's client script, if the compressed Blob is equal to or larger than the source file (`newSize >= originalSize`), the tool discards the larger output, keeps your original file untouched, and labels the row **Already optimal** so your file never gets bigger.

Four situations account for nearly every stubborn file:

| Symptom | Root Cause | Recommended Fix |
| --- | --- | --- |
| **WebP saved from a website shows "Already optimal"** | Modern CDNs already deliver WebP around 70%–80% quality, so Slight (85%) or Normal (75%) produces no savings | Retry on Strong, or lower pixel width first via [Resize Image](/en/image-resize) |
| **JPG saved from messaging or social apps barely shrinks** | The platform already resized and heavily recompressed the photo on upload | Keep the original as-is, or try Strong while checking faces and text |
| **A camera photo saved as PNG stays multiple megabytes** | Photographic color complexity clashes with lossless PNG storage even after 256-color quantization | When transparency is unneeded, convert with [PNG to JPG](/en/png-to-jpg) first, then run [Compress JPG](/en/compress-jpg) |
| **A 4K/8K image still exceeds 1 MB even on Strong** | Total pixel count (e.g., 6000×4000 = 24 MP) dominates file size more than quality settings | Shrink dimensions to the real display width (1200–2000 px) with [Resize Image](/en/image-resize), then compress |

If your file is not JPG, PNG, or WebP—such as an iPhone `.heic` photo or scanner `.tiff`—the compressor rejects the unsupported format upfront. Convert first with [HEIC to JPG](/en/heic-to-jpg) or [Image to JPG](/en/convert-to-jpg); for a full breakdown of background colors and size jumps during format conversion, see [How to Convert HEIC, PNG, and WebP to JPG: Fixing Unopenable Files, Black Backgrounds, and Larger Sizes](/en/blog/heic-png-webp-to-jpg).

## Transparency, Gradients, and Text Screenshots: Avoiding PNG & WebP Pitfalls

Photos are rarely the source of rework—**transparent assets and text-heavy screenshots** are. Handle these three categories carefully:

1. **Transparent logos, icons, and AI cutouts:**
   After creating transparent cutouts with [AI Remove Background](/en/image-remove-bg), run them through [Compress PNG](/en/compress-png) on Slight (256 colors) or Normal (128 colors). Pure flat-color logos often look crisp even on Strong (64 colors), whereas soft product shadows or feathered hair edges stay much smoother on Slight or Normal. For end-to-end cutout and white-background tips, see [How to Remove an Image Background: AI Cutouts, Transparent PNGs, and White or Custom Backdrops](/en/blog/remove-background-transparent-png).
2. **Code snippets, spreadsheets, and chat screenshots with tiny text:**
   Keep them in PNG and use Slight or Normal in [Compress PNG](/en/compress-png) so characters stay razor sharp. If a portal strictly demands JPG, flatten onto white with [PNG to JPG](/en/png-to-jpg) and stick to Slight or Normal in [Compress JPG](/en/compress-jpg)—avoid Extreme, which introduces ringing noise around thin strokes.
3. **Static transparent WebP vs. animated WebP:**
   Static WebP files with transparency keep their Alpha channel cleanly in [Compress WebP](/en/compress-webp). Animated WebP and APNG files, however, are flattened to a single static frame—do not drop animated stickers into static image compression if motion must survive.

## Resize First or Compress First? Optimal Order by Goal

When you face a strict upload cap (such as 200 KB for an avatar) or want faster Largest Contentful Paint (LCP) on a website, **the order of operations matters more than cranking up compression strength**.

| Goal | Recommended Workflow Order | Why This Order Wins |
| --- | --- | --- |
| **Camera photo for an application form (200–500 KB cap)** | [Crop Image](/en/image-crop) (if aspect ratio required) → [Resize Image](/en/image-resize) (1000–1600 px long edge) → [Compress JPG](/en/compress-jpg) (Normal/Strong) | Reducing 12 MP down to actual display pixels lets you stay at ~75% quality with far sharper detail than Extreme at full resolution |
| **Website & e-commerce image optimization** | Standardize width with [Resize Image](/en/image-resize) → photos via [Compress JPG](/en/compress-jpg), transparent assets via [Compress PNG](/en/compress-png) or [Compress WebP](/en/compress-webp) | Eliminates oversized browser downloads and matches each asset to its ideal encoder; "Keep original file names" simplifies directory replacement |
| **Oversized photographic PNG** | [PNG to JPG](/en/png-to-jpg) (white backdrop) → optional [Compress JPG](/en/compress-jpg) | Switches from lossless storage to photo-friendly encoding before trimming quality |
| **WebP rejected by legacy Office or forms** | [WebP to JPG](/en/webp-to-jpg) → [Compress JPG](/en/compress-jpg) if file grew | Fixes compatibility first, then trims the 0.95-quality conversion output to target size |
| **Multiple photos bundled into a lightweight PDF** | Local [Resize Image](/en/image-resize) + [Compress Image](/en/image-compress) → [JPG to PDF](/en/jpg-to-pdf) or [Image to PDF](/en/image-to-pdf) | Entire pipeline stays free and local; shrinking images before embedding avoids needing server-side PDF compression afterward |

If you also need to tame oversized PDFs alongside images, see [Files Too Large to Upload? Compress, Resize, or Split](/en/blog/file-too-large-to-upload).

## Browser-Local Batch Workflow: Paste Upload, Original Filenames & ZIP Packing

Four built-in details make recurring batch compression faster and less error-prone:

1. **Drag-and-drop, multi-select, and clipboard paste:** Add up to **30 images** per batch (**25 MB** each), or press `Ctrl+V` / `Cmd+V` anywhere on the page to paste screenshots straight from your clipboard. Duplicate files (same name, size, and modified time) are skipped automatically.
2. **"Keep original file names" enabled by default:** Located next to the compression level selector and persisted in your browser's `localStorage`, keeping original names lets web developers and store operators drop compressed outputs straight back into asset directories. Uncheck it when you want `_compressed` appended (e.g., `banner_compressed.jpg`) to keep originals alongside compressed copies.
3. **Parallel Web Worker pool (up to 3 workers):** Compression runs off the main thread so the interface stays responsive while displaying original size, compressed size, and savings percentage per row plus total batch savings at the top.
4. **Single downloads and collision-safe ZIPs:** Download individual images or click **Download all** to package finished items locally into `docsmall-image-compressed.zip`. If two files from different folders share the same filename, the ZIP adds `-2`, `-3` automatically instead of overwriting one.

## 7-Point Pre-Delivery Inspection Checklist

Before publishing compressed images or submitting them to a client or portal, run this quick 30-second check:

- [ ] **Inspect text, numbers, and QR codes at 100% zoom** to verify readability and scannability.
- [ ] **Preview transparent PNGs and WebPs on both light and dark backgrounds** to spot any haloing or gradient banding.
- [ ] **Review every "Already optimal" row** to confirm its existing size fits your upload limit—or resize it if it still exceeds the cap.
- [ ] **Confirm no animated WebP or APNG was accidentally flattened** to a static frame.
- [ ] **Check your filename toggle** so extracting a ZIP does not unintentionally overwrite master originals.
- [ ] **Archive original master files** whenever EXIF timestamps, GPS coordinates, or ICC color profiles matter long term.
- [ ] **Save downloads immediately**, because local results live only in current tab memory and clear on reload.

## 7 Common Compression Issues and How to Fix Them

| Issue | Likely Cause | Solution |
| --- | --- | --- |
| **"Unsupported file format" error on upload** | File is HEIC, TIFF, BMP, SVG, GIF, or misnamed with the wrong extension | Convert HEIC via [HEIC to JPG](/en/heic-to-jpg), TIFF via [Image to JPG](/en/convert-to-jpg), or compress GIFs with [Compress GIF](/en/gif-compress) |
| **File rejected for exceeding 25 MB** | Uncompressed high-megapixel PNG or oversized camera export | Save a standard JPG or downscale dimensions locally first, then compress |
| **Only the first 30 files entered the queue** | Per-batch queue cap is 30 images | Compress and download the first 30, clear the queue, and run the next batch |
| **Visible color bands in a PNG gradient on Strong/Extreme** | 64-color or 32-color palette lacks enough steps for smooth gradients | Switch back to Slight (256 colors) or Normal (128 colors) and click "Compress again," or convert to JPG if transparency is unnecessary |
| **Small text in a JPG looks fuzzy with artifacts** | 50% or 20% quality introduces ringing around sharp high-contrast strokes | Re-run at Slight (85%) or Normal (75%); keep UI/text screenshots as PNG whenever allowed |
| **Animated WebP stops moving after compression** | Static image compressor outputs a single frame from animated WebP | Keep the original animated WebP or process GIF animations via [Compress GIF](/en/gif-compress) |
| **Compressed results vanished after refreshing the tab** | Local tools do not upload files or store server history | Download individual files or click "Download all" before refreshing or closing the page |

## Privacy Boundaries and When to Use Another Tool

docsmall's [Compress Image](/en/image-compress), [Compress JPG](/en/compress-jpg), [Compress PNG](/en/compress-png), and [Compress WebP](/en/compress-webp) are **100% browser-local and free**: images are decoded, quantized, and re-encoded solely inside your device's Web Workers and **never leave your computer**, with no account required and no daily credit limit. That makes them safe for ID photos, scanned contracts, and unreleased product mockups.

Use a different tool when your workflow requires:

- **Preserving EXIF metadata, GPS coordinates, RAW bit depth, or CMYK/Adobe RGB print color profiles** for archival photography or prepress.
- **Hitting an exact target byte ceiling (such as strictly under 200 KB) on multi-megapixel photos** without manual step-downs—pair [Resize Image](/en/image-resize) with fixed compression levels, or use a local script with binary quality search.
- **Preserving animation in GIF, animated WebP, or APNG**—use [Compress GIF](/en/gif-compress) for GIFs or a dedicated animated encoder for WebP/APNG.
- **Automating folders of thousands of images or files larger than 25 MB**, where CLI tools or desktop batch processors are a better fit.

## Frequently asked questions

### Does compressing an image change its pixel width or height?

No. [Compress Image](/en/image-compress), [Compress JPG](/en/compress-jpg), [Compress PNG](/en/compress-png), and [Compress WebP](/en/compress-webp) only reduce encoded file size while keeping the original pixel dimensions intact. If a 4000×3000 photo only needs to display at 1200 px wide on a webpage, shrink the dimensions first with [Resize Image](/en/image-resize) and then compress—you will get a much smaller file at higher visual clarity.

### Why do transparent PNG icons stay transparent after compression, while soft gradients sometimes show slight banding?

Standard browser PNG encoders have no lossy quality slider, so docsmall compresses PNG files via UPNG indexed-color palette quantization (256 colors on Slight, 128 on Normal, 64 on Strong, and 32 on Extreme) while keeping the Alpha transparency channel intact. Flat icons and UI assets shrink cleanly, but large soft drop shadows or smooth gradients can show subtle color stepping at 64 or 32 colors—switch to Slight or Normal for those assets.

### Why is a camera photo saved as PNG still huge even after compression?

Continuous-tone photographs contain thousands of subtle color transitions. PNG is a lossless format designed for sharp graphics and transparency, so even a 256-color quantized PNG is often several times larger than a visually comparable JPG and can look patchy on skin tones or skies. If you do not need transparency, convert it first with [PNG to JPG](/en/png-to-jpg) and then use [Compress JPG](/en/compress-jpg).

### Why does a WebP or previously saved image show 'Already optimal'?

Whenever the re-encoded output is equal to or larger than the original file size, docsmall discards the bloated output, keeps your original file, and marks it 'Already optimal.' This commonly happens with CDN-optimized WebP files, photos re-saved from social apps, or ultra-simple PNGs. Try a stronger level or reduce pixel dimensions first.

### Do animated WebP or animated PNG (APNG) files keep their animation after compression?

No. docsmall's image compressor targets static JPG, PNG, and WebP files. When an animated WebP or APNG is loaded, browser decoding reads only a single static frame (typically the first frame) and drops the animation. For animated assets, use [Compress GIF](/en/gif-compress) for GIFs or a dedicated animated-WebP encoder.

### Are EXIF dates, GPS coordinates, and camera metadata preserved after compression?

No. Local browser Canvas re-encoding writes fresh pixel data and does not copy EXIF timestamps, camera models, GPS locations, or ICC color profiles into the output file. This helps protect privacy when sharing images online, though you should always keep original backups for photo archives or print color management.

### What does 'Keep original file names' do, and what happens if two files share the same name in a ZIP?

When 'Keep original file names' is checked (enabled by default and remembered in your browser), downloaded files keep their exact source names—ideal for overwriting website assets or product folders in place. Unchecking it appends `_compressed` before the extension so you can keep both versions side by side. Inside `docsmall-image-compressed.zip`, duplicate filenames from different folders automatically receive `-2`, `-3` suffixes to prevent overwrites.

### Are images uploaded to a server during compression, and how many can I process at once?

Nothing is uploaded, no registration is required, and the tool is completely free. Decoding, quantization, and re-encoding run locally in your browser across up to 3 parallel Web Workers. You can add up to 30 images per batch (up to 25 MB each). Results stay only in current page memory and disappear if you refresh or close the tab, so download individual files or the ZIP archive promptly.

### What if my image still exceeds a strict upload limit (such as 200 KB or 500 KB) after compression?

Check whether the pixel resolution is far larger than needed—for instance, shrinking a 4000 px photo to 1200 px with [Resize Image](/en/image-resize) before running Normal or Strong in [Compress Image](/en/image-compress) yields far sharper results than forcing Extreme at full resolution. For photographic PNGs, switch to JPG first. For a complete workflow covering both images and PDFs, read [Files Too Large to Upload? Compress, Resize, or Split](/en/blog/file-too-large-to-upload).
