home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Crawly Crypt Collection 2
/
crawlyvol2.bin
/
graphics
/
jpeg5
/
bin
/
cjpeg.man
next >
Wrap
Text File
|
1994-08-08
|
5KB
|
133 lines
CJPEG(1) USER COMMANDS CJPEG(1)
NAME
cjpeg - compress an image file to a JPEG file
SYNOPSIS
cjpeg [ -Q _✓q_✓u_✓a_✓l_✓i_✓t_✓y ] [ -oTIad ] [ -m _✓m_✓e_✓m_✓o_✓r_✓y ] [ _✓f_✓i_✓l_✓e_✓n_✓a_✓m_✓e ]
DESCRIPTION
cjpeg compresses the named image file, or the standard input
if no file is named, and produces a JPEG/JFIF file on the
standard output. The currently supported image file formats
are: PPM (PBMPLUS color format), PGM (PBMPLUS gray-scale
format), GIF, Targa, and RLE (Utah Raster Toolkit format).
(RLE is supported only if the URT library is available.)
OPTIONS
-Q _✓q_✓u_✓a_✓l_✓i_✓t_✓y
Scale quantization tables to adjust image quality.
Quality is 0 (worst) to 100 (best); default is 75.
(See below for more info.)
-o Perform optimization of entropy encoding parameters.
Without this, default encoding parameters are used. -o
usually makes the JPEG file a little smaller, but cjpeg
runs somewhat slower and needs much more memory. Image
quality and speed of decompression are unaffected by
-o.
-T Input file is Targa format. Targa files that contain
an "identification" field will not be automatically
recognized by cjpeg; for such files you must specify -T
to force cjpeg to treat the input as Targa format.
-I Generate noninterleaved JPEG file (not yet supported).
-a Use arithmetic coding rather than Huffman coding (not
currently supported for legal reasons).
-d Enable debug printout. More -d's give more output.
Also, version information is printed at startup.
-m _✓m_✓e_✓m_✓o_✓r_✓y
Set limit for amount of memory to use in processing
large images. Value is in thousands of bytes, or mil-
lions of bytes if "M" is attached to the number. For
example, -m 4m selects 4000000 bytes. If more space is
needed, temporary files will be used.
The -Q switch lets you trade off compressed file size
against quality of the reconstructed image: the higher the
-Q setting, the larger the JPEG file, and the closer the
output image will be to the original input. Normally you
want to use the lowest -Q setting (smallest file) that
Sun Release 4.1 Last change: 28 February 1992 1
CJPEG(1) USER COMMANDS CJPEG(1)
decompresses into something visually indistinguishable from
the original image. For this purpose the -Q setting should
be between 50 and 95; the default of 75 is often about
right. If you see defects at -Q 75, then go up 5 or 10
counts at a time until you are happy with the output image.
(The optimal setting will vary from one image to another.)
-Q 100 will generate a quantization table of all 1's, elim-
inating loss in the quantization step (but there is still
information loss in subsampling, as well as roundoff error).
This setting is mainly of interest for experimental pur-
poses. -Q values above about 95 are not recommended for nor-
mal use; the compressed file size goes up dramatically for
hardly any gain in output image quality.
In the other direction, -Q values below 50 will produce very
small files of low image quality. Settings around 5 to 10
might be useful in preparing an index of a large image
library, for example. Try -Q 2 (or so) for some amusing
Cubist effects. (Note: -Q values below about 25 generate
2-byte quantization tables, which are considered optional in
the JPEG standard. cjpeg emits a warning message when you
give such a -Q value, because some commercial JPEG programs
may be unable to decode the resulting file.)
EXAMPLES
This example compresses the PPM file foo.ppm with a quality
factor of 60 and saves the output as foo.jpg:
cjpeg -Q _✓6_✓0 _✓f_✓o_✓o._✓p_✓p_✓m > _✓f_✓o_✓o._✓j_✓p_✓g
SEE ALSO
djpeg(1)
ppm(5), pgm(5)
Wallace, Gregory K. "The JPEG Still Picture Compression
Standard", Communications of the ACM, April 1991 (vol. 34,
no. 4), pp. 30-44.
AUTHOR
Independent JPEG Group
BUGS
Arithmetic coding and interleaved output not yet supported.
Not all variants of Targa file format are supported.
The -T switch is not a bug, it's a feature. (It would be a
bug if the Targa format designers had not been clueless.)
Not as fast as we'd like.
Sun Release 4.1 Last change: 28 February 1992 2