# XT Massive Image Optimizer User's Guide

# Overview and Quick Setup

XT Massive Image Optimizer (opens new window) is a command-line to optimize images and streamline the usage of tools to improve the web performance.

Once XT Massive Image Optimizer command-line is installed, it can be executed to process and optimize all images from a source directory source-directory and store them in a target-directory target-directory.

For instance, this is a sample command:

# How it works


XT Massive Image Optimizer is based on the psliwa / image-optimizer (opens new window), Image optimization / compression library. This library can optimize png, jpg, and gif files straightforwardly and handily.

XT Massive Image Optimizer processes all the images from a source directory. It executes a series of image optimization tools on each image and stores the result in a target diretory.

This is the list of tools that are executed:

  • gifsicle (opens new window)
    • -O3, Optimize output GIF animations for space, try several optimization methods.
  • jpegoptim (opens new window)
    • --strip-all, Strip all (Comment & Exif) markers from output file. (NOTE! by default only Comment & Exif markers are kept, everything else is discarded)
    • --all-progressive, Force all output files to be progressive.
    • --max=92, Sets the maximum image quality factor. This option will reduce quality of those source files that were saved using higher quality setting. While files that already have lower quality setting will be compressed using the lossless optimization method.
  • jpegtran (opens new window)
    • -optimize, perform optimization of entropy encoding parameters.
    • -progressive, create progressive JPEG file.
  • optipng (opens new window), PNG optimizer that recompresses image files to a smaller file size, without losing any information.
  • pngout (opens new window), it optimizes the file size of .PNG files losslessly.
  • pngquant (opens new window), the conversion reduces file sizes significantly (often as much as 70%) and preserves full alpha transparency.

XT Massive Image Optimizer is a general image optimization package, available as a command-line to process large batches of images. It is designed to be executed in a server terminal or iteratively by the Cron Job.

After the first iteration, when all images are optimized from the source directory to the target directory, the xt-mio only process the newer images. Thus, the command can be executed periodically by a Cron Job.

# Acknowledgements

# Further Reading

Last Updated: 2/29/2024, 2:54:14 PM