SJPEG(1)

NAME
sjpeg - compress a PNG, JPEG or PPM image file to a baseline JPEG file

SYNOPSIS
sjpeg [options] input_file -o output_file.jpg

DESCRIPTION
This manual page documents the sjpeg command.

sjpeg compresses a PNG, JPEG or PPM image or recompresses a JPEG image, using the baseline JPEG format.

OPTIONS
The basic options are:

-o string
    Specify the name of the output JPEG file.

-h, -help
    A summary of all the possible options.

-version
    Print the version number (as major.minor.revision) and exit.

-q float
    Specify the compression factor between 0 and 100. The default is 75. A small factor produces a smaller file with lower quality. Best quality is achieved by using a value of 100. If the input source is a JPEG file, the compression factor will be limited to never exceed the source's quality unless the -no_limit option is used. This option is disabled by subsequent use (in parsing order) of the -r option.

-r float
    Specify the reduction factor for JPEG source. The default is 100 (no reduction). A small reduction factor produces a smaller file with lower quality. When using a value of 100, the source JPEG file is only recompressed with closed to no quality loss (but file size will likely be smaller). This option is disabled by subsequent use (in parsing order) of the -q option.

-size int
    Specify a target size to try and reach using several passes. By default, the internal search loop will try to get as close as possible to the specified size. This option has precedence over the -pnsr one. See also the -pass option.

-psnr float
    Specify a target PSNR to try and reach using several passes. By default, the internal search loop will try to get as close as possible to the specified distortion. Note that the Peak-Signal-to-Noise is computed using the YUV samples, not the RGB ones. See also the -pass option.

-tolerance float
    Tolerance (in percent) used during convergence to target value when -psnr or -size option is used.

-qmin int
    Minimum acceptable quality factor used during the search (when -psnr or -size option is used). The search will halt if the quality adjustment would drop lower than the qmin value.

-qmax int
    Maximum acceptable quality factor used during the search (when -psnr or -size option is used). The search will avoid using a quality factor larger than the qmax value.

-pass int
    Specify the number of internal loop to use for convergence toward a target size or distortion. If none is specified but -size or -psnr option is used, then a default value of 10 is used.

-yuv_mode  int
    Specify the YUV color space method to use. Possible values are

    0: automatic decision (default)

    1: use YUV 4:2:0 downsampling

    2: use 'Sharp' YUV 4:2:0 downsampling - slower but more accurate

    3: use YUV 4:4:4 (full resolution for U/V chroma planes)

-444
    Shortcut for -yuv_mode 3

-sharp
    Shortcut for -yuv_mode 2

-420
    Shortcut for -yuv_mode 1

-estimate
    If the source is a JPEG file, print the estimated quality and exit.

-i, -info
    Print some information about the input file and exit.

-xmp string
    Specify the output XMP metadata. Warning, this will overwrite any data available from the source. No content validation is performed.

-exif string
    Specify the output EXIF metadata. Warning, this will overwrite any data available from the source. No content validation is performed.

-icc string
    Specify the output Color Profile metadata. Warning, this will overwrite any data available from the source. No content validation is performed.

-quiet
    Disable information message (error messages are still printed).

-short
    Only display short information about the output result.

-crc
    Only display the CRC32 checksum of the output and exit.

-md5
    Only display the MD5 digest of the output and exit.

-no_limit
    Disable the quantization limit (in case of JPEG input file) allowing to recompress the source at a higher quality factor (result is uncertain, though!).

-no_adapt
    Disable adaptive quantization optimization (faster processing, larger file)

-trellis
    Enable trellis-based quantization (slower processing, but produces file optimized for rate-distortion)

-no_optim
    Disable Huffman code optimization (faster processing, larger file)

-adapt_bias
    Disable the adaptive bias optimization.

-no_metadata
    Disable transfer of metadata from source to JPEG (saves file size, but discards information).

BUGS
Please report any bugs to the SJPEG discussion list: https://groups.google.com/forum/#!forum/sjpeg The issue tracker is located at: https://github.com/webmproject/sjpeg/issues
Patches welcome! See this page to get started: http://www.webmproject.org/code/contribute/submitting-patches/

EXAMPLES
sjpeg -q 50 picture.png -o picture.jpg
sjpeg picture.jpg -r 90 -o optimized_jpeg.jpg

AUTHORS
sjpeg was written by Pascal Massimino.
The latest source tree is available at http://www.webmproject.org/code

This manual page was written by Pascal Massimino <pascal.massimino@gmail.com>, for the Debian project (and may be used by others).

SEE ALSO
cjpeg(1),djpeg(1)

  Input file format details
PPM: http://netpbm.sourceforge.net/doc/ppm.html