Batch image processing in the browser — how it works
Process up to 10 images at once without uploading a single file. Here's the architecture behind browser-based batch processing.
Most online image tools process one file at a time. Drop an image, wait, download, repeat. When you have 10 product photos to compress, that's 10 round-trips to a server and 10 download clicks.
Tiny Pixel Kit handles up to 10 images in a single batch — and none of them leave your browser.
How it works
When you drop multiple files into any tool, here's what happens under the hood:
-
File reading: Each file is read into browser memory using the File API. No network request is made.
-
Queue creation: A processing queue is created with each file as a task. The queue tracks status (pending, processing, done, error) for each image.
-
Web Worker processing: Each image is processed in a Web Worker — a background thread that doesn't block the UI. This means you can scroll, click, and interact with the page while images are being processed.
-
Canvas API: Inside the Worker, the image is decoded, manipulated (compressed, resized, or converted), and re-encoded using the Canvas API.
-
Result collection: Processed images are collected back in the main thread as Blob URLs — downloadable links pointing to in-memory data.
-
ZIP packaging: When you click "Download all", the results are packaged into a ZIP file using JSZip, entirely in browser memory.
Why Web Workers matter
Without Web Workers, processing a large image would freeze the browser tab. The main thread — the one responsible for rendering the page and handling your clicks — would be blocked until the processing finished.
Web Workers run in a separate thread. The main thread stays responsive, progress bars update smoothly, and you can cancel processing mid-batch if needed.
Memory considerations
Browser-based processing uses your device's RAM. A single 4000 × 3000 JPEG might use 50 MB of memory when decoded (width × height × 4 bytes per pixel). A batch of 10 such images could use 500 MB.
In practice, Tiny Pixel Kit processes images sequentially within the batch to keep memory usage predictable. Each image is decoded, processed, and its uncompressed data released before the next one starts.
Performance benchmarks
On a modern laptop (M1/M2 MacBook or equivalent), typical batch processing times:
| Operation | 1 image | 10 images | | ----------------------- | ------- | --------- | | Compress (JPEG → WebP) | ~100ms | ~800ms | | Resize (2000px → 800px) | ~80ms | ~600ms | | Convert (PNG → AVIF) | ~400ms | ~3.5s |
AVIF encoding is the slowest operation because the codec is computationally intensive. JPEG and WebP are significantly faster.
The ZIP download
When processing multiple images, downloading them one by one is tedious. The "Download all as ZIP" button:
- Creates an in-memory ZIP archive using JSZip
- Adds each processed image to the archive
- Generates a downloadable Blob URL
- Triggers a download of the ZIP file
The entire ZIP creation happens in the browser — no server involved.
Try it
Drop 5–10 images into the compressor and watch them process in parallel. You'll see individual progress for each file, and the ZIP download button appears when all files are ready.