How to Batch Compress Images Without Uploading to a Server
Most image compressors upload your files to remote servers. Here's how client-side tools process images locally in your browser using WebAssembly.
The problem with uploading your images
When you use TinyPNG, ShortPixel, or most online image compressors, your images are uploaded to their servers for processing. That means:
- A copy of your image exists on someone else's server
- You're trusting their data retention policies
- Sensitive images (client work, mockups, personal photos) are exposed
- You're dependent on their uptime and speed
- Large files take time to upload and download
For a quick screenshot, this might not matter. But for a batch of 10 client mockups or proprietary product photos, it's a real concern.
Client-side compression: how it works
Client-side image compression runs entirely in your browser. Your images never leave your device. Here's what happens under the hood:
- You select files from your computer
- The browser reads them into memory using the File API
- WebAssembly (WASM) codecs decode, process, and re-encode the images
- The compressed results are created as downloadable blobs
- You download the results
For more information about the File API, see the MDN documentation.
No network requests. No uploads. No servers involved in the image processing.
What is WebAssembly?
WebAssembly is a binary format that lets browsers run code at near-native speed. Image compression codecs (like MozJPEG, libpng, and libwebp) are written in C/C++ and compiled to WASM, so they run in the browser with the same performance as desktop applications.
For more information about WebAssembly and browser capabilities, see the MDN WebAssembly documentation.
This is how Pikkx works — it uses jSquash, a set of WASM-compiled image codecs, to compress, resize, and convert images entirely in your browser tab.
You can verify that a tool is truly client-side: disconnect from the internet after the page loads and try compressing an image. If it still works, no data is leaving your device.
Client-side vs server-side comparison
Tools that process images locally
Pikkx (web, free)
Batch compress up to 10 images at once. Supports JPEG, PNG, and WebP with format conversion and resizing. Built with jSquash WebAssembly codecs.
Strengths: True batch processing, format conversion, resize in one step, clean UI. Limitation: 10 images per batch (free tier).
Squoosh (web, free)
Google's open-source compressor. Offers granular control over codec settings with a side-by-side comparison view.
Strengths: Maximum control over compression parameters, AVIF support. Limitation: One image at a time — no batch processing on the web version.
ImageOptim (macOS, free)
Desktop application that runs locally. Uses multiple compression engines (MozJPEG, pngquant, Gifsicle) and picks the best result.
Strengths: Unlimited batch, lossless by default, runs completely offline. Limitation: macOS only, no format conversion, no WebP support.
Command line (free)
For developers comfortable with the terminal:
# Batch compress to WebP with cwebp
for f in *.jpg *.png; do
cwebp "$f" -o "${f%.*}.webp" -q 80
done
# Batch resize and compress with sharp-cli
npx sharp-cli resize 1200 --withoutEnlargement -i *.jpg -o output/ -f webp
Strengths: Unlimited, scriptable, integrates into build pipelines. Limitation: Requires installation and command line comfort.
Best practices for batch compression
1. Resize before compressing
Always resize to your target dimensions first. Compressing a 4000px image and then displaying it at 800px wastes bandwidth. Resize to 800px, then compress — the file will be dramatically smaller.
2. Use consistent settings
For a batch of images going to the same place (product photos, blog thumbnails), use the same format and quality settings. This ensures visual consistency across your site.
3. Keep your originals
Never overwrite your source files. Always compress into a separate output folder. You might need to re-compress at different settings later, and you can't un-compress a lossy image.
4. Test with one image first
Before batch processing 50 images, compress one and check the result. Verify the quality is acceptable, the dimensions are correct, and the file size meets your target.
When server-side processing makes sense
Client-side tools aren't always the best choice:
Very large batches (100+ images): Browser memory can become a constraint. A server or CLI tool handles this better.
Automated pipelines: If images are uploaded by users or generated programmatically, you need server-side processing integrated into your pipeline.
Maximum compression ratio: Server-side tools sometimes squeeze out a few extra percent because they can run slower, more intensive algorithms without worrying about browser responsiveness.
For everything else — especially when privacy matters, or you're processing a reasonable batch of images for a website — client-side tools are the practical choice.
Batch compress images privately
Process up to 10 images at once — compress, resize, and convert in your browser. Nothing is uploaded.