How Browser Memory, Object URLs, and ZIP Archiving Scale in Batches
Under the hood of sequential canvas decoding, ImageBitmap cleanup, Web Worker offloading, and in-memory ZIP generation.
Primary Browser Tool
Bulk Image Compressor
Compress batches of PNG, JPEG, and WebP files simultaneously and download all optimized results in one ZIP archive.
Why Sequential Decoding Matters in JavaScript
A single decoded 4000 × 3000 RGBA bitmap occupies 48 MB of uncompressed RAM on the GPU/CPU heap. Decoding 30 images in parallel with `Promise.all` would spike memory past 1.4 GB and crash mobile tabs.
RapidPNG processes bulk queues sequentially: decode one `ImageBitmap`, encode the compressed Blob, call `bitmap.close()` immediately to free native surface memory, then advance to the next item.
Practical Examples
ZIP Streaming vs. Store Compression
Because WebP and JPEG blobs are already entropy-compressed, storing them into a ZIP container is nearly instantaneous.
Common Mistakes & Honest Limitations
Mistakes to Avoid
- Accumulating unreleased `URL.createObjectURL` handles across repeated batch runs.
Technical Limitations
- Browser tabs typically enforce per-tab heap limits around 1–4 GB depending on device hardware.