YOGA Command Line Interface

YOGA Image Optimizer is based on YOGA that is a Python library and a CLI tool to convert and optimize images and 3D models.

YOGA features a complete and easy to use command line interface. Here is a basic command to optimize an image:

yoga image input.png output.png

Complete usage:

usage: yoga image [-h] [-v] [-q] [--output-format {orig,auto,jpeg,png}]
                  [--resize {orig,<SIZE>,<WIDTH>x<HEIGHT>}] [--jpeg-quality 0-100]
                  [--opacity-threshold 0-255]
                  input output

positional arguments:
  input                 Input file path
  output                Output file path

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose         enable verbose mode
  -q, --quiet           enable quiet mode (takes precedence over verbose)
  --output-format {orig,auto,jpeg,png,webp,webpl}
                        format of the output image
  --resize {orig,<SIZE>,<WIDTH>x<HEIGHT>}
                        resize the image
  --jpeg-quality 0-100  JPEG quality if the output format is set to 'jpeg'
  --webp-quality 0-100  WEBP quality if the output format is set to 'webp'
  --opacity-threshold 0-255
                        threshold below which a pixel is considered transparent
  --png-slow-optimization
                        enable a (very) slow optimization preset for PNGs that
                        can sometimes gain few bytes on the output file

Read more in the YOGA's official documentation: