2N/A<!
DOCTYPE REFENTRY PUBLIC "-//Sun Microsystems//DTD DocBook V3.0-Based SolBook Subset V2.0//EN" [
2N/A<!--ArborText, Inc., 1988-1999, v.4002-->
2N/A<!
ENTITY cmd "cjpeg">
2N/A<!
ENTITY suncopy "Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.">
2N/A<?
Pub UDT _bookmark _target>
2N/A<
refentry id="cjpeg-1">
2N/A<!-- %Z%%M% %I% %E% SMI; --> 2N/A<
refmeta><
refentrytitle>cjpeg</
refentrytitle><
manvolnum>1</
manvolnum>
2N/A<
refmiscinfo class="date">26 Mar 2004</
refmiscinfo>
2N/A<
refmiscinfo class="sectdesc">&man1;</
refmiscinfo>
2N/A<
refmiscinfo class="software">&release;</
refmiscinfo>
2N/A<
refmiscinfo class="arch">generic</
refmiscinfo>
2N/A<
refmiscinfo class="copyright">&suncopy;</
refmiscinfo>
2N/A<
indexterm><
primary>cjpeg</
primary></
indexterm><
indexterm><
primary>compress
2N/Aan image file to a JPEG file</
primary></
indexterm>
2N/A<
refnamediv id="cjpeg-1-name"><
refname>cjpeg</
refname><
refpurpose>compress
2N/Aan image file to a JPEG file</
refpurpose></
refnamediv>
2N/A<
refsynopsisdiv id="cjpeg-1-synp"><
title>&synp-tt;</
title>
2N/A<
cmdsynopsis><
command>&cmd;</
command><
arg choice="opt"><
option role="nodash"><
replaceable>
2N/Aoptions</
replaceable></
option></
arg><
arg choice="opt"><
option role="nodash"><
replaceable>
2N/Afilename</
replaceable></
option></
arg>
2N/A</
cmdsynopsis></
refsynopsisdiv>
2N/A<
refsect1 id="cjpeg-1-desc"><
title>&desc-tt;</
title>
2N/A<
para><
command>&cmd;</
command> compresses the named image file, or the standard
2N/Ainput if no file is named, and produces a
JPEG/
JFIF file on the standard output.
2N/AThe following input file formats are currently supported:</
para>
2N/A<
listitem><
para>BMP</
para></
listitem>
2N/A<
listitem><
para>PGM, the PBMPLUS gray-scale format</
para></
listitem>
2N/A<
listitem><
para>PPM, the PBMPLUS color format</
para></
listitem>
2N/A<
listitem><
para>RLE, the Utah Raster Toolkit format</
para></
listitem>
2N/A<
listitem><
para>Targa</
para></
listitem>
2N/A<
para>RLE is supported only if the URT library is available.</
para>
2N/A<
refsect1 id="cjpeg-1-opts"><
title>&opts-tt;</
title>
2N/A<
para>All options may be abbreviated. For example, <
option>grayscale</
option>
2N/Amay be written <
option>gray</
option> or <
option>gr</
option>. Upper and lower
2N/Acase are equivalent. For example, <
option>BMP</
option> is the same as <
option>
2N/Abmp</
option>. British spellings are also accepted. For example, <
option>greyscale
2N/A<
refsect2 id="cjpeg-1-opts-basic">
2N/A<
title>Basic Options</
title>
2N/A<
para>The following basic options are supported:</
para>
2N/A<
variablelist termlength="medium">
2N/A<
varlistentry><
term><
option>grayscale</
option></
term><
listitem><
para>Create
2N/Aa monochrome JPEG file from color input. You should use this switch when compressing
2N/Aa grayscale BMP file, because <
command>&cmd;</
command> cannot detect whether
2N/Aa BMP file uses only shades of gray. By specifying the <
option>grayscale</
option>
2N/Aoption, you create a smaller JPEG file that takes less time to process.</
para>
2N/A</
listitem></
varlistentry>
2N/A<
varlistentry><
term><
option>optimize</
option></
term><
listitem><
para>Optimize
2N/Athe entropy encoding parameters. If you do not specify this option, default
2N/Aencoding parameters are used. <
option>optimize</
option> usually makes the
2N/AJPEG file a little smaller, but <
command>&cmd;</
command> runs more slowly
2N/Aand needs much more memory. Image quality and speed of decompression are unaffected
2N/Aby the <
option>optimize</
option> option.</
para>
2N/A</
listitem></
varlistentry>
2N/A<
varlistentry><
term><
option>progressive</
option></
term><
listitem><
para>Create
2N/Aa progressive JPEG file. For more information about the <
option>progressive
2N/A</
option> option, see the Extended Description section.</
para>
2N/A</
listitem></
varlistentry>
2N/A<
varlistentry><
term><
option>quality <
replaceable>N</
replaceable></
option></
term>
2N/A<
listitem><
para>Scale the quantization tables to adjust image quality. <
replaceable>
2N/AN</
replaceable> ranges from 0 (worst) to 100 (best). The default value is
2N/A75. For more information about the <
option>quality</
option> option, see the
2N/AExtended Description section.</
para>
2N/A</
listitem></
varlistentry>
2N/A<
varlistentry><
term><
option>targa</
option></
term><
listitem><
para>Specify that
2N/Athe input file is in Targa format. Targa files that contain an "identification"
2N/Afield are not automatically recognized by <
command>&cmd;</
command>. For such
2N/Afiles, you must specify <
option>targa</
option> to make <
command>&cmd;</
command>
2N/Atreat the input as Targa format. For most Targa files, you do not need this
2N/A</
listitem></
varlistentry>
2N/A</
variablelist></
refsect2>
2N/A<
refsect2 id="cjpeg-1-opts-int">
2N/A<
title>Intermediate Options</
title>
2N/A<
para>The following intermediate options are supported:</
para>
2N/A<
variablelist termlength="medium">
2N/A<
varlistentry><
term><
option>dct fast</
option></
term><
listitem><
para>Use the
2N/Afast integer DCT method. This method is less accurate than the integer DCT
2N/Amethod or the floating-point DCT method.</
para>
2N/A</
listitem></
varlistentry>
2N/A<
varlistentry><
term><
option>dct float</
option></
term><
listitem><
para>Use the
2N/Afloating-point DCT method. The float method is very slightly more accurate
2N/Athan the int method, but is much slower unless your machine has very fast
2N/Afloating-point hardware. The results of the floating-point method may vary
2N/Aslightly across machines, while the integer methods should give the same results
2N/A</
listitem></
varlistentry>
2N/A<
varlistentry><
term><
option>dct int</
option></
term><
listitem><
para>Use the
2N/Ainteger DCT method. This is the default method.</
para>
2N/A</
listitem></
varlistentry>
2N/A<
varlistentry><
term><
option>maxmemory <
replaceable>N</
replaceable></
option></
term>
2N/A<
listitem><
para>Set the limit for the amount of memory to use in processing
2N/Alarge images. <
replaceable>N</
replaceable> is specified in thousands of bytes,
2N/Aor in millions of bytes if "M" is specified with the number. For example, <
option>
2N/Amax 4m</
option> selects 4000000 bytes. If more space is needed, temporary
2N/Afiles are used.</
para>
2N/A</
listitem></
varlistentry>
2N/A<
varlistentry><
term><
option>outfile <
replaceable>name</
replaceable></
option></
term>
2N/A<
listitem><
para>Send the output image to the named file, instead of to the
2N/Astandard output.</
para>
2N/A</
listitem></
varlistentry>
2N/A<
varlistentry><
term><
option>restart <
replaceable>N</
replaceable></
option></
term>
2N/A<
listitem><
para>Emit a JPEG restart marker every <
replaceable>N</
replaceable>
2N/AMCU rows, or every <
replaceable>N</
replaceable> MCU blocks if "B" is specified
2N/Awith the number. The default value is <
option>restart 0</
option>, which means
2N/Ano restart markers. For more information about the <
option>restart</
option>
2N/Aoption, see the Extended Description section.</
para>
2N/A</
listitem></
varlistentry>
2N/A<
varlistentry><
term><
option>smooth <
replaceable>N</
replaceable></
option></
term>
2N/A<
listitem><
para>Smooth the input image to eliminate dithering noise. <
replaceable>
2N/AN</
replaceable> ranges from 1 to 100, and indicates the strength of smoothing.
2N/AThe default value is <
option>smooth 0</
option>, which means no smoothing.
2N/AFor more information about the <
option>smooth</
option> option, see the Extended
2N/ADescription section.</
para>
2N/A</
listitem></
varlistentry>
2N/A<
varlistentry><
term><
option>verbose</
option></
term><
listitem><
para>Display
2N/Aversion information at startup, and enable debug printout. The <
option>vv
2N/A</
option> option displays more verbose output than the <
option>v</
option>
2N/Aoption. The <
option>vvv</
option> option displays the most verbose output.
2N/A<
para>You can also use <
option>debug</
option> to specify this option.</
para>
2N/A</
listitem></
varlistentry>
2N/A</
variablelist></
refsect2>
2N/A<
refsect2 id="cjpeg-1-opts-adv">
2N/A<
title>Advanced Options</
title>
2N/A<
para>The following advanced options are supported for advanced users only:
2N/A<
variablelist termlength="medium">
2N/A<
varlistentry><
term><
option>baseline</
option></
term><
listitem><
para>Force
2N/Abaseline-compatible quantization tables to be generated. This clamps the quantization
2N/Avalues to 8 bits, even at low quality settings. This option is poorly named,
2N/Abecause <
option>baseline</
option> does not ensure that the output is actually
2N/Abaseline JPEG. For example, you can use the <
option>baseline</
option> and <
option>
2N/Aprogressive</
option> options together.</
para>
2N/A</
listitem></
varlistentry>
2N/A<
varlistentry><
term><
option>qslots <
replaceable>N</
replaceable>[,...]</
option></
term>
2N/A<
listitem><
para>Select which quantization table to use for each color component.
2N/A</
listitem></
varlistentry>
2N/A<
varlistentry><
term><
option>qtables <
replaceable>file</
replaceable></
option></
term>
2N/A<
listitem><
para>Use the quantization tables provided in the specified text
2N/A</
listitem></
varlistentry>
2N/A<
varlistentry><
term><
option>sample HxV[,...]</
option></
term><
listitem><
para>
2N/ASet the JPEG sampling factors for each color component.</
para>
2N/A</
listitem></
varlistentry>
2N/A<
varlistentry><
term><
option>scans <
replaceable>file</
replaceable></
option></
term>
2N/A<
listitem><
para>Use the scan script provided in the specified text file.</
para>
2N/A</
listitem></
varlistentry>
2N/A</
variablelist></
refsect2>
2N/A<
refsect1 id="cjpeg-1-oper"><
title>&oper-tt;</
title>
2N/A<
para>The following operands are supported:</
para>
2N/A<
variablelist termlength="medium">
2N/A<
varlistentry><
term><
option role="nodash"><
replaceable>filename</
replaceable></
option></
term>
2N/A<
listitem><
para>The name of the image file to be compressed.</
para>
2N/A</
listitem></
varlistentry>
2N/A</
variablelist></
refsect1>
2N/A<
refsect1 id="cjpeg-1-exde"><
title>&exde-tt;</
title>
2N/A<
refsect2 id="cjpeg-1-exde-quality">
2N/A<
title>The <
option>quality</
option> Option</
title>
2N/A<
para>The <
option>quality</
option> option enables you to trade compressed
2N/Afile size against the quality of the reconstructed image: the higher the quality
2N/Asetting, the larger the JPEG file, and the greater the similarity between
2N/Athe output image and the original input. Normally, you use the lowest quality
2N/Asetting that decompresses into an output image that is visually indistinguishable
2N/Afrom the original image. For this purpose, the quality setting should be between
2N/A50 and 95. The default value of 75 is often just right. If you see defects
2N/Aat <
option>quality 75</
option>, increase the quality by 5 until you are happy
2N/Awith the output image. The optimal setting varies from one image to another.
2N/A<
para>A value of <
option>quality 100</
option> generates a quantization table
2N/Aof ones. This minimizes loss in the quantization step, but information is
2N/Astill lost in subsampling, as well as roundoff error. The <
option>quality
2N/A100</
option> setting is mainly of interest for experimental purposes. Quality
2N/Avalues above 95 are not recommended for normal use, as the compressed file
2N/Asize increases dramatically for very little gain in output image quality.
2N/A<
para>Quality values below 50 produce very small files of low image quality.
2N/ASettings of 5 to 10 might be useful in preparing an index of a large image
2N/Alibrary, for example. Quality values below 25 generate 2-byte quantization
2N/Atables, which are considered optional in the JPEG standard. <
command>&cmd;</
command>
2N/Aemits a warning message when you specify such a quality value, because some
2N/Aother JPEG programs might be unable to decode the resulting file. Use <
option>
2N/Abaseline</
option> if you need to ensure compatibility at low quality values.
2N/A<
refsect2 id="cjpeg-1-exde-prog">
2N/A<
title>The <
option>progressive</
option> Option</
title>
2N/A<
para>The <
option>progressive</
option> option creates a "progressive JPEG"
2N/Afile. In this type of JPEG file, the data is stored in multiple scans of increasing
2N/Aquality. If the file is transmitted over a slow communications link, the decoder
2N/Acan use the first scan to display a low-quality image very quickly, and can
2N/Athen improve the display with each subsequent scan. The final image is exactly
2N/Aequivalent to a standard JPEG file of the same quality setting, and the total
2N/Afile size is about the same, or a little smaller. Caution: progressive JPEG
2N/Ais not yet widely implemented, so many decoders are unable to view a progressive
2N/AJPEG file at all.</
para>
2N/A<
refsect2 id="cjpeg-1-exde-restart">
2N/A<
title>The <
option>restart</
option> Option</
title>
2N/A<
para>The <
option>restart</
option> option inserts extra markers that allow
2N/Aa JPEG decoder to resynchronize after a transmission error. Without restart
2N/Amarkers, any damage to a compressed file usually ruins the image from the
2N/Apoint of the error to the end of the image. With restart markers, the damage
2N/Ais usually confined to the portion of the image from the point of the error
2N/Ato the next restart marker. The restart markers occupy extra space. We recommend <
option>
2N/Arestart 1</
option> for images that are transmitted across unreliable networks.
2N/A<
refsect2 id="cjpeg-1-exde-smooth">
2N/A<
title>The <
option>smooth</
option> Option</
title>
2N/A<
para>The <
option>smooth</
option> option filters the input to eliminate fine-scale
2N/Anoise. This option is often useful when you convert dithered images to JPEG:
2N/Aa moderate smoothing factor of 10 to 50 deletes dithering patterns from the
2N/Ainput file, resulting in a smaller JPEG file and a better-looking image. If
2N/Athe smoothing factor is too large, the image visibly blurs.</
para>
2N/A<
refsect2 id="cjpeg-1-exde-hints">
2N/A<
para>Color GIF files are not the ideal input for JPEG. JPEG is really intended
2N/Afor the compression of full-color 24-bit images. In particular, do not try
2N/Ato convert cartoons, line drawings, or other images that have only a few distinct
2N/Acolors. GIF works well on these, but JPEG does not. If you want to convert
2N/Aa GIF file to JPEG, you should experiment with the <
option>quality</
option>
2N/Aand <
option>smooth</
option> options to get a satisfactory conversion. A value
2N/Aof <
option>smooth 10</
option> is often helpful.</
para>
2N/Acycles. Image quality loss will accumulate. After ten cycles, the image may
2N/Abe noticeably worse than it was after one cycle. Use a lossless format while
2N/Amanipulating an image, then convert to JPEG format when you are ready to file
2N/Athe image away. </
para>
2N/A<
para>Use the <
option>optimize</
option> option when you make a "final" version
2N/Afor posting or archiving. Also, when you use low quality settings, make very
2N/Asmall JPEG files. The percentage improvement is often much greater than on
2N/Alarger files. At present, the <
option>optimize</
option> option is always selected
2N/Awhen generating progressive JPEG files.</
para>
2N/A<
refsect1 id="cjpeg-1-exam"><
title>&exam-tt;</
title>
2N/A<
example role="example">
2N/A<
title>Compressing the PPM File
test.ppm With a Quality Factor of 60 and Saving
2N/A</
userinput></
screen></
para>
2N/A<
refsect1 id="cjpeg-1-envr"><
title>&envr-tt;</
title>
2N/A<
para><
command>&cmd;</
command> uses the following environment variables:</
para>
2N/A<
varlistentry><
term>JPEGMEM</
term><
listitem><
para>The value of this environment
2N/Avariable, if set, is the default memory limit. The value is specified as described
2N/Afor the <
option>maxmemory</
option> option. JPEGMEM overrides the default value
2N/Aspecified when the program was compiled, and is in turn overridden by an explicit <
option>
2N/Amaxmemory</
option> option.</
para>
2N/A</
listitem></
varlistentry>
2N/A</
variablelist></
refsect1>
2N/A<
refsect1 id="cjpeg-1-attr"><
title>&attr-tt;</
title>
2N/A<
para>See <
olink targetdocent="REFMAN5" localinfo="attributes-5"><
citerefentry>
2N/A<
refentrytitle>attributes</
refentrytitle><
manvolnum>5</
manvolnum></
citerefentry></
olink>
2N/Afor descriptions of the following attributes:</
para>
2N/A<
informaltable frame="all">
2N/A<
tgroup cols="2" colsep="1" rowsep="1"><
colspec colname="COLSPEC0" colwidth="1*">
2N/A<
colspec colname="COLSPEC1" colwidth="1*">
2N/A<
row><
entry align="center" valign="middle">ATTRIBUTE TYPE</
entry><
entry align="center" 2N/Avalign="middle">ATTRIBUTE VALUE</
entry></
row>
2N/A<
row><
entry><
para>Availability</
para></
entry><
entry><
para>SUNWjpg</
para></
entry>
2N/A<
row><
entry colname="COLSPEC0"><
para>Interface stability</
para></
entry><
entry 2N/Acolname="COLSPEC1"><
para>Uncommitted</
para></
entry></
row>
2N/A<
refsect1 id="cjpeg-1-also"><
title>&also-tt;</
title>
2N/A<!--Reference to another man page--> 2N/A<!--Reference to a Help manual--> 2N/A<!--Reference to a book.--> 2N/A<
para>Wallace, Gregory K., <
citetitle>The JPEG Still Picture Compression Standard
2N/A</
citetitle> Communications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44.
2N/A<
para><
citerefentry><
refentrytitle>djpeg</
refentrytitle><
manvolnum>1</
manvolnum>
2N/A</
citerefentry>, <
citerefentry><
refentrytitle>jpegtran</
refentrytitle><
manvolnum>
2N/A1</
manvolnum></
citerefentry>, <
citerefentry><
refentrytitle>rdjpgcom</
refentrytitle>
2N/A<
manvolnum>1</
manvolnum></
citerefentry>, <
citerefentry><
refentrytitle>wrjpgcom
2N/A</
refentrytitle><
manvolnum>1</
manvolnum></
citerefentry></
para>
2N/A<
refsect1 id="cjpeg-1-note"><
title>¬e-tt;</
title>
2N/A<
para>Arithmetic coding is not supported. GIF input files are not supported.
2N/ANot all variants of BMP and Targa file formats are supported.</
para>
2N/A<
para>This man page was originally written by the Independent JPEG Group.
2N/AUpdated by Breda McColgan, Sun Microsystems Inc., 2004. </
para>