packages icon

 JPEG(1)                                                             JPEG(1)
                                14 June 1993

      jpeg - JPEG compression and decompression

      jpeg -iw ImageWidth -ih ImageHeight [-JFIF] [-q(l) Q-Factor]
           [-a] [-b] [-d] [-k predictortype] [-n] [-o] [-y] [-z]
           [-p PrecisionValue] [-t pointtransform]
           [-r ResyncInterval] [-s StreamName]
           [[-ci ComponentIndex1] [-fw FrameWidth1] [-fh FrameHeight1]
            [-hf HorizontalFrequency1] [-vf VerticalFrequency1]
           [[-ci ComponentIndex2] [-fw FrameWidth2] [-fh FrameHeight2]
            [-hf HorizontalFrequency2] [-vf VerticalFrequency2]

      jpeg is a still-image compression/decompression program that performs
      JPEG encoding and decoding of multiple raster-scanned files.

           specifies the width of the original image. This should correspond
           to the width of the widest component and, thus, the width of the
           ``original image''. All components have widths roughly
           corresponding to an integer decimation ratio from this

           specifies the height of the tallest component. This corresponds
           to the height of the ``original image''.

           specifies that a JFIF header is placed on the encoded stream.
           This is unnecessary for decoding.

           option specifies a multiplicative factor for the quantization:
           each quantization coefficient of the default matrix is scaled by
           (Q-Factor/50). A Q-Factor of 0 is the same thing as a Q-Factor of
           50 because it disables this function. -q specifies an 8 bit
           quantization matrix; -ql specifies a 16 bit quantization matrix,
           useful for 12 bit data.

      -a   enables the double-precision floating point Reference DCT.
           (Default is Chen DCT.)

      -b   enables the Lee DCT.  (Default is Chen DCT.)

      -d   enables decoding.  See below.

                                    - 1 -           Formatted:  May 30, 2020

 JPEG(1)                                                             JPEG(1)
                                14 June 1993

      -k predictortype
           The lossless predictor type, specified as an integer between 1-7.
           If specified, then lossless mode is used.

      -n   This option specifies that the files should not be transmitted in
           interleaved format.

      -o   signals that the command interpreter will read from the standard

      -p   Specifies the precision.  Normally should be between 2-16 for
           lossless; 8 or 12 for DCT.  If it is specified as a number
           greater than 8 then the input is considered to be unsigned shorts
           (16 bits, msb first). Not aggressively checked.

      -t pointtransform
           Specifies the shifting (right) upon loading input and shifting
           (left) upon writing input.  Generally used by the lossless mode
           only.  Can be used by the DCT mode to add or subtract bits.

      -y   for decoding only, signals that no resynchronization is enabled,
           thus ignore any markers found in the data stream.

      -z   enables use of default Huffman tables. This converts the coding
           from a two-pass system using the first pass to generate custom
           tables to a one-pass system using internal default tables. With
           this option, the compression speed is nearly doubled, but because
           the internal tables are not custom to the image, the compressed
           file size increases slightly.

           specifies a resync (restart) interval for the input file--if set
           to 0 (default), resynchronization is disabled; otherwise it
           signifies the number of MDU between a resync marker.

           is the place to  load(decoder)/store(encoder) the coded image--if
           unspecified it defaults to ComponentFile1.jpg.

           For every component in the image we have:

           describes the component index where the file data should be
           associated with.  The possible values are between 0 and 255.  As
           a rule Y is in 1; U is in 2; V is in 3.  The file specfications,
           if left undisturbed, will result in component location of 1 for
           the first component file, 2 for the second component file, and so
           on.  If -ci is specified for the previous component file, then
           the next component index defaults to the previous component index
           plus 1.

                                    - 2 -           Formatted:  May 30, 2020

 JPEG(1)                                                             JPEG(1)
                                14 June 1993

           describes the actual width of the component. This should be
           determinable by the size of the original image (ImageHeight and
           ImageWidth) and the frequency sampling of that component.  This
           program assumes that the sampling component will be round up to
           the nearest integer and other programs may not necessarily follow
           that convention, we allow precise specification of the
           FrameWidth.  The program will notify the user if the framewidth
           and frameheight specifications do not correspond to a logical MDU
           pattern and thus will refuse to take the input (in fact,
           sometimes rounding down will not result in a logical MDU

           describes the actual height of the component. Multiplied together
           with FrameWidth, this should equal the file size of the
           component.  See the above discussion on the actual specification.

           specifies the block sampling frequency of the component in the
           horizontal direction for every MDU transmitted.

           specifies the block sampling frequency of the component in the
           vertical direction. When multiplied together with the Horizontal
           frequency, it corresponds to the number of blocks of that
           component in the MDU.

           represents the directory path location of the nth component file.

      In order to encode a set of raster-scanned files: 128x128 in image.Y;
      64x128 in image.U; and 64x128 in image.V into the file image.jpg, the
      command is

      jpeg -iw 128 -ih 128  -hf 2 image.Y image.U image.V -s image.jpg

      In order to decode a compressed file in image.jpg, type

      jpeg -d -s image.jpg

      The three output files will be in image.jpg.1 image.jpg.2 image.jpg.3.
      The images can be displayed by the cv program.  The images can also be
      converted to ppm and back through the programs cyuv2ppm and ppm2cyuv
      Those utility programs available by anonymous ftp from
      There are many more options within an internal command interpreter.
      Please see the accompanying documentation in for more details.

                                    - 3 -           Formatted:  May 30, 2020

 JPEG(1)                                                             JPEG(1)
                                14 June 1993

      jpeg is available by anonymous ftp from

      Somewhat slower than many commercial implementations, some bugs are
      probably lurking around.  Lossless coding and decoding are especially
      slow.  Please inform the author at if any bugs
      are found.

      Andy Hung

                                    - 4 -           Formatted:  May 30, 2020