Dev.to WebDev πŸ›  Dev πŸ‘ 0 πŸ“– 7 min read

Compress and Convert Thousands of Images in Your Browserβ€”No Installation NeededπŸš€

A folder of 500 product photos shouldn't mean 500 separate trips through an image compressor. Neither should 600 screenshots or 1,000 images for a website migration mean installing a desktop application just to prepare t

Compress and Convert Thousands of Images in Your Browserβ€”No Installation NeededπŸš€

A folder of 500 product photos shouldn't mean 500 separate trips through an image compressor. Neither should 600 screenshots or 1,000 images for a website migration mean installing a desktop application just to prepare the files.

I built CompressFly to make image compression and format conversion available directly in the browser, including batches that run into thousands of images.

The important engineering decision is how the application manages work and memory. It doesn't need to keep every image fully decoded at the same time. It processes a limited number of images, releases their temporary processing resources, and keeps taking work from the queue.

500, 600, and 1,000 are examples of batch sizes, not preset limits. I also tested 1,000 images in each of two batch runs: JPG compression and conversion to WebP. The current image selection and scheduling flow doesn't impose a fixed image-count ceiling. The practical limit still depends on image dimensions, formats, browser resources, and the device doing the work.

Bulk image compression without installing software

For everyday image preparation, the browser can now provide the whole workflow: select local files, compress or convert them on the device, then download the results.

In CompressFly, you can choose multiple images, select a folder where supported, or drag files into the page. You apply settings to the batch instead of opening and exporting each file separately.

For example:

Image collection Batch job
500 JPG product photos Reduce file sizes before adding them to a store
600 PNG screenshots Compress them, or convert suitable assets to WebP
1,000 mixed JPG and PNG images Prepare a consistent output format for a site migration
2,000 existing WebP images Run another compression pass when different settings suit the destination

These are workflow examples, not benchmark results or guaranteed completion counts for every device. A folder containing 2,000 small web images is a different workload from 2,000 full-resolution camera photos.

Why a batch of 1,000 images doesn't need 1,000 active tasks

The browser's File API lets a web application read files the user selects. Selecting a folder doesn't require the application to immediately decode every image into pixels.

That distinction matters because a compressed file and its decoded image have very different memory requirements.

Consider the 3680 Γ— 2066 dimensions used in my tests. A single RGBA pixel buffer requires:

3680 Γ— 2066 Γ— 4 bytes = 30,411,520 bytes, or roughly 29 MiB.

That is one buffer for one image, before accounting for decoder memory, encoder workspaces, previews, and the output. Keeping 1,000 buffers of that size at once would require about 28.3 GiB just for those buffers, exceeding this computer's 16 GB of memory. This is a theoretical buffer-size calculation, not a measurement of the application's actual memory use.

CompressFly uses a queue with limited concurrency. A few tasks run while the remaining files wait. When one task finishes, its slot becomes available and the next image starts. A slower image occupies its own slot; other slots can continue moving through the batch.

The queue can contain 500, 600, 1,000, or more files without requiring that many decoders to run together.

A queue of 1,000 images feeding a limited number of active processing tasks, followed by downloadable results.

Conceptual illustration: 1,000 queued images is an example, not a batch limit.

Finish an image, release its working resources, continue

Limiting concurrency controls the number of active tasks. Cleaning up after each image prevents completed tasks from unnecessarily keeping their processing resources alive.

In the image-processing paths I reviewed, workers used for encoding or conversion are terminated after returning their results. Worker references are cleared, and temporary object URLs are revoked where those URLs are created for the processing operation. Relevant paths also transfer buffers to workers instead of copying them unnecessarily.

The cycle is straightforward:

  1. Take the next image from the queue.
  2. Decode it and perform the requested compression or conversion.
  3. Keep the output needed for preview or download.
  4. Release the task's temporary processing resources and free its queue slot.
  5. Start the next waiting image.

That is what makes a batch of thousands practical: the application keeps moving through the collection instead of accumulating thousands of active image-processing workspaces.

There is an important boundary here. Releasing working resources doesn't mean the batch uses zero memory. The page still keeps file references, previews, and completed outputs needed for downloads. The browser also controls when eligible JavaScript memory is reclaimed. Per-image cleanup reduces processing pressure; it doesn't promise unlimited total capacity.

Web Workers keep heavy processing away from the interface

Web Workers run scripts in background threads. CompressFly uses worker-based processing paths for its image operations, so substantial encoding and conversion work can happen away from the page's main thread.

This gives the interface room to display progress and individual results while the queue advances. It doesn't make processing free: the CPU and memory still belong to the user's device.

Each image also has its own processing status. An individual failure can be recorded while the scheduler continues with other queued files. For a large batch, that is more useful than treating one unsupported or damaged image as the failure of the entire collection.

Tested: 1,000 images on a 13-inch M2 MacBook Pro

I ran both tests on my 13-inch MacBook Pro (M2, 2022). Here is the hardware configuration and the input used for each run:

Test detail Configuration
Computer 13-inch MacBook Pro, 2022
Chip Apple M2
CPU 8 cores
Memory 16 GB unified memory
Images per run 1,000 JPG files
Size of each source file 5.51 MB, as displayed in the tool
Dimensions of each source image 3680 Γ— 2066 pixels

These were two separate batch operations, each containing 1,000 files. The source files shared the size and dimensions listed above; this wasn't a test across 1,000 different image sizes or formats.

JPG compression: 1,000 out of 1,000 completed

With image quality set to 85%, and Keep metadata and Lossless unchecked, the compressor reported Compressed 1000/1000.

The visible sample results went from 5.51 MB to 889.06 KB per image, a displayed reduction of 84.24%, while retaining 3680 Γ— 2066 dimensions. The batch summary reported 4.53 GB reduced (84%). These figures are the tool's displayed values, including its rounding.

CompressFly completing JPG compression for 1,000 of 1,000 images at 85% quality, with a visible sample reduced from 5.51 MB to 889.06 KB at unchanged dimensions.

My compression test: 1,000 JPG images completed in one batch on the M2 MacBook Pro.

JPG to WebP: 1,000 out of 1,000 completed

For the conversion test, I selected WebP output and 90% image quality. The converter reported Converted 1000/1000.

The visible sample results went from 5.51 MB to 1004.2 KB per image, a displayed reduction of 82.20%, with dimensions still 3680 Γ— 2066.

CompressFly completing conversion of 1,000 of 1,000 JPG images to WebP at 90% quality, with visible sample outputs of 1004.2 KB at unchanged dimensions.

My conversion test: 1,000 JPG images converted to WebP in one batch on the same computer.

Both runs completed in the browser without installing a desktop image-processing application. The screenshots document completion and output sizes; they don't record elapsed time or peak memory usage. The savings describe this image set and these settings, rather than a compression ratio every image will achieve.

Compression and conversion solve different problems

Use bulk image compression when you want smaller files while keeping a supported source format. The general compressor accepts JPG/JPEG, PNG, WebP, and GIF images.

Use the batch image converter when you need a different output format. The converter offers outputs including JPG, PNG, WebP, AVIF, and TIFF. Conversion can change the file size, but changing formats doesn't guarantee a smaller result.

For example, 600 PNG screenshots might need PNG compression when the destination requires PNG. If the destination accepts WebP, a PNG-to-WebP workflow offers another option. For photographs that need broad compatibility, JPG may be the appropriate output.

Check representative results before applying settings to the full collection. Look at fine text, transparency, edges, and color. Keep the originals when creating lossy sharing or web copies.

How to process a folder of images in CompressFly

Select images, compress or convert them inside the browser, and save the results as a ZIP without installing a desktop application.

  1. Open the compressor or converter and add your images. Use multiple selection, folder selection where available, or drag and drop.
  2. Choose compression settings, or select an output format and quality for conversion. Start the batch and let the queue work through the files.
  3. Review the completed results, then download individual images or use Download all to collect them in a ZIP.

The application builds the ZIP locally. Its download implementation supports a streaming path where available and a fallback that assembles the archive in memory. Export therefore has its own resource requirements, especially for a large collection of outputs.

For a batch of 1,000 or 2,000 images, keep the tab open until processing and downloading finish. If the collection consists of unusually large images or the device is short on memory, smaller batches remain a useful option.

Local processing means the images stay on your device

The source images in this workflow aren't uploaded to an image-processing server. Compression, conversion, and ZIP creation run on the device.

The website still loads its application and processing resources over the network. Local image processing shouldn't be confused with a claim that the website makes no network requests or that every tool is available offline.

For the user, the benefit is practical: preparing 500 product photos, 600 screenshots, or a collection of more than 1,000 images can start in a browser tab, without downloading a separate desktop application.

If you want to try that workflow, open CompressFly's image compressor or image converter, choose your files, and let the queue handle the collection.

πŸ“° Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.