The bugoman/jpeg-archive Docker image is designed to compress .jpg and .jpeg images using the jpeg-archive tools. This image is versatile and can handle both batch processing of multiple files and single-file processing using the jpeg-recompress tool or other jpeg-archive binaries.
To compress a single image, you can directly call the jpeg-archive tool inside the container. For example:
docker run --rm --user 1000:1000 \
-v $(pwd)/img:/img \
bugoman/jpeg-archive \
jpeg-recompress --quiet --strip --quality medium --method smallfry \
/img/input.jpg /img/output.jpg
This command will compress the input.jpg file in the /img directory and save it as output.jpg in the same directory.
If you need to process multiple files located in a single folder, you can use the batch.sh script. This script will automatically find all .jpg and .jpeg files in the /input directory and compress them in parallel.
To run the image for batch processing, use the following command:
docker run --rm --user 1000:1000 \
-v $(pwd)/input:/input \
-v $(pwd)/output:/output \
bugoman/jpeg-archive \
batch.sh --quiet --strip --quality medium --method smallfry
The batch.sh script will scan the /input directory for .jpg and .jpeg files, compress them using multiple parallel processes, and save the compressed files to the /output directory. By default, the script calculates the number of parallel processes based on the system's available CPU cores to optimize performance.
If you want to manually control the number of parallel processes used for batch processing, you can set the NUM_PROCESSES environment variable. For example, to use 4 parallel processes:
docker run --rm --user 1000:1000 \
-v $(pwd)/input:/input \
-v $(pwd)/output:/output \
-e NUM_PROCESSES=4 \
bugoman/jpeg-archive \
batch.sh --quiet --strip --quality medium --method smallfry
Content type
Image
Digest
sha256:a11683d99…
Size
4.1 MB
Last updated
almost 2 years ago
docker pull bugoman/jpeg-archive