summary refs log tree commit diff
path: root/jpegtopnm.html
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2006-12-25 03:06:05 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2006-12-25 03:06:05 +0000
commit1017cbebe5d5edd859e0fddad0a8600f509f4821 (patch)
tree78bdf336648566f7a7d55f42837357dea3dd674c /jpegtopnm.html
parent16f2ac126651015a376eba864a3a35f738b0b25a (diff)
downloadnetpbm-mirror-1017cbebe5d5edd859e0fddad0a8600f509f4821.tar.gz
netpbm-mirror-1017cbebe5d5edd859e0fddad0a8600f509f4821.tar.xz
netpbm-mirror-1017cbebe5d5edd859e0fddad0a8600f509f4821.zip
Place user guide into Subversion repository
git-svn-id: http://svn.code.sf.net/p/netpbm/code/userguide@181 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'jpegtopnm.html')
-rw-r--r--jpegtopnm.html339
1 files changed, 339 insertions, 0 deletions
diff --git a/jpegtopnm.html b/jpegtopnm.html
new file mode 100644
index 00000000..86a44d50
--- /dev/null
+++ b/jpegtopnm.html
@@ -0,0 +1,339 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML><HEAD><TITLE>Jpegtopnm User Manual</TITLE></HEAD>
+<BODY>
+<H1>JPEGTOPNM</H1>
+Updated: 13 October 2002
+<BR>
+<A HREF="#index">Table Of Contents</A>
+
+<A NAME="lbAB">&nbsp;</A>
+<H2>NAME</H2>
+jpegtopnm - convert JPEG/JFIF file to PPM or PGM image
+
+<A NAME="lbAC">&nbsp;</A>
+<H2>SYNOPSIS</H2>
+
+<B>jpegtopnm</B>
+[<B>-dct</B> {<B>int</B>|<B>fast</B>|<B>float</B>}]
+[<B>-nosmooth</B>]
+[<B>-maxmemory</B> <I>N</I>]
+[{<B>-adobe</B>|<B>-notadobe</B>}]
+[<B>-comments</B>]
+[<B>-dumpexif</B>]
+[<B>-exif=</B><I>filespec</I>]
+[<B>-multiple</B>]
+[<B>-verbose</B>]
+[<B>-tracelevel</B> <I>N</I>]
+[<I>filename</I>]
+
+<p>Minimum unique abbreviation of option is acceptable.  You may use double
+hyphens instead of single hyphen to denote options.  You may use white
+space in place of the equals sign to separate an option name from its value.
+
+<A NAME="description">&nbsp;</A>
+<H2>DESCRIPTION</H2>
+
+<p>This program is part of <a href="index.html">Netpbm</a>.
+
+<P><B>jpegtopnm</B> converts JFIF images to PPM or PGM images.
+
+<p>By default, <b>jpegtopnm</b> expects the input stream to contain one
+JFIF image and produces one PGM or PPM image as output.  It fails if the
+input stream is empty.
+
+<p>But with the <b>-multiple</b> option, <b>jpegtopnm</b> reads JFIF
+images sequentially from the input stream and writes one PPM or PGM image
+to the output stream for each JFIF input.  If the input stream is empty,
+so is the output.
+
+<p>The input stream is the <i>filename</i> you specify or, if you
+don't specify <i>filename</i>, Standard Input.  The output stream is
+Standard Output.
+
+<p>If a JFIF input image is of the grayscale variety, <B>jpegtopnm</B>
+generates a PGM image.  Otherwise, it generates a PPM image.
+
+<p>Before Netpbm 10.11 (October 2002), <b>jpegtopnm</b> did not have
+the multiple image stream capability.  From 10.11 through 10.22,
+Netpbm always behaved as if you specified <b>-multiple</b>.  Starting
+with Netpbm 10.23 (July 2004), Netpbm's default behavior went back to
+the pre-10.11 behavior and the new <b>-multiple</b> option selected
+the 10.12 behavior.  The reason for the reversion was that there were
+discovered in the world files that contain JFIF images followed by
+something other than another JFIF image.  The producers of these files
+expect them to work with any JFIF interpreter because most JFIF
+interpreters just stop reading the file after the first JFIF image.
+
+<p><B>jpegtopnm</B> uses the Independent JPEG Group's JPEG library to
+interpret the input file.  See <B><A
+HREF="http://www.ijg.org">http://www.ijg.org</A> </B>
+for information on the library.
+
+<P>&quot;JFIF&quot; is the correct name for the image format commonly
+known as &quot;JPEG.&quot; Strictly speaking, JPEG is a method of
+compression.  The image format using JPEG compression that is by far
+the most common is JFIF.  There is also a subformat of TIFF that uses
+JPEG compression.
+
+<P>EXIF is an image format that is a subformat of JFIF (to wit, a JFIF
+file that contains an EXIF header as an APP1 marker).
+<B>jpegtopnm</B> handles EXIF.
+
+<P>JFIF files can have either 8 bits per sample or 12 bits per sample.
+The 8 bit variety is by far the most common.  There are two versions
+of the IJG JPEG library.  One reads only 8 bit files and the other
+reads only 12 bit files.  You must link the appropriate one of these
+libraries with <B>jpegtopnm</B>.  Ordinarily, this means the library
+is in your shared library search path when you run <B>jpegtopnm</B>.
+
+<P><B>jpegtopnm</B> generates output with either one byte or two bytes
+per sample depending on whether the JFIF input has either 8 bits or 12
+bits per sample.  You can use <B>pamdepth</B> to reduce a
+two-byte-per-sample file to a one-byte-per-sample file if you need to.
+
+<P>If the JFIF file uses the CMYK or YCCK color space, the input does
+not actually contain enough information to know what color each pixel
+is.  To know what color a pixel is, one would have to know the
+properties of the inks to which the color space refers.
+<B>jpegtopnm</B> interprets the colors using the common transformation
+which assumes all the inks are simply subtractive and linear.
+
+<p>See the <a href="jpegtopnm.html"><B>jpegtopnm</B> manual</a>
+for information on how images lose quality when you convert to and
+from JFIF.
+
+<A NAME="lbAE">&nbsp;</A>
+<H2>OPTIONS</H2>
+
+The options are only for advanced users:
+<DL COMPACT>
+<DT><B>-dct int</B>
+
+<DD>
+Use integer DCT method (default).
+
+<DT><B>-dct fast</B>
+
+<DD>
+Use fast integer DCT (less accurate).
+
+<DT><B>-dct float</B>
+
+<DD>
+Use floating-point DCT method.
+The float method is very slightly more accurate than the int method, but is
+much slower unless your machine has very fast floating-point hardware.  Also
+note that results of the floating-point method may vary slightly across
+machines, while the integer methods should give the same results everywhere.
+The fast integer method is much less accurate than the other two.
+
+<DT><B>-nosmooth</B>
+
+<DD>
+Use a faster, lower-quality upsampling routine.
+<DT><B>-maxmemory</B><I> N</I>
+
+<DD>Set limit on the amount of memory <B>jpegtopnm</B> uses in
+processing large images.  Value is in thousands of bytes, or millions
+of bytes if &quot;M&quot; is suffixed to the number.  For example,
+<B>-maxmemory 4m</B> selects 4000000 bytes.  If <B>jpegtopnm</B> needs
+more space, it uses temporary files.
+
+<DT><B>-adobe</B>
+<DT><B>-notadobe</B>
+
+<DD>
+There are two variations on the CMYK (and likewise YCCK) color space that
+may be used in the JFIF input.  In the normal one, a zero value for a color
+components indicates absence of ink.  In the other, a zero value means the
+maximum ink coverage.  The latter is used by Adobe Photoshop when it creates
+a bare JFIF output file (but not when it creates JFIF output as part of
+Encapsulated Postscript output).  
+
+<P>These options tell <B>jpegtopnm</B> which version of the CMYK or
+YCCK color space the image uses.  If you specify neither,
+<B>jpegtopnm</B> tries to figure it out on its own.  In the present
+version, it doesn't try very hard at all: It just assumes the
+Photoshop version, since Photoshop and its emulators seem to be the
+main source of CMYK and YCCK images.  But with experience of use,
+future versions might be more sophisticated.
+
+<P>If the JFIF image does not indicate that it is CMYK or YCCK, these
+options have no effect.
+
+<P>If you don't use the right one of these options, the symptom is
+output that looks like a negative.
+
+<DT><B>-dumpexif</B>
+
+<DD>Print the interpreted contents of any Exif header in the input
+file to the Standard Error file.  Similar to the program <B>jhead</B>
+(not part of the Netpbm package).
+
+<p>This option was added in Netpbm 9.19 (September 2001).
+     
+<DT><B>-exif=</B><I>filespec</I>
+
+<DD>Extract the contents of the EXIF header from the input image and
+write it to the file <I>filespec</I>.  <I>filespec</I>=<B>-</B> means
+write it to Standard Output.  When you write the EXIF header to
+Standard Output, <B>jpegtopnm</B> does not output the converted image
+(which is what normally would go to Standard Output) at all.
+
+<p><B>jpegtopnm</B> writes the contents of the EXIF header
+byte-for-byte, starting with the two byte length field (which length
+includes those two bytes).
+
+<P>You can use this file as input to <B>pnmtojpeg</B> to insert an
+identical EXIF header into a new JFIF image.
+
+<P>If there is no EXIF header, <B>jpegtopnm</B> writes two bytes of
+binary zero and nothing else.
+
+<P>An EXIF header takes the form of a JFIF APP1 marker.  Only the
+first such marker within the JFIF header counts.
+
+<p>This option was added in Netpbm 9.19 (September 2001).
+
+<DT><B>-multiple</B>
+
+<dd>Read multiple JFIF images sequentially from the input stream.
+See <a href="#description">Description section</a> for details.
+
+<p>This option was new in Netpbm 10.23 (July 2004).
+
+<DT><B>-comments</B>
+
+<DD>
+Print any comments in the input file to the Standard Error file.
+<DT><B>-verbose</B>
+
+<DD>
+Print details about the conversion to the Standard Error file.
+<DT><B>-tracelevel</B><I> n</I>
+
+<DD>Turn on the JPEG library's trace messages to the Standard Error
+file.  A higher value of <I>n</I> gets more trace information.
+<B>-verbose</B> implies a trace level of at least 1.
+
+</DL>
+<A NAME="lbAF">&nbsp;</A>
+<H2>EXAMPLES</H2>
+
+<P>This example converts the color JFIF file foo.jpg to a PPM file
+named foo.ppm:
+
+<PRE>
+    jpegtopnm foo.jpg &gt;foo.ppm
+</PRE>
+
+<A NAME="lbAG">&nbsp;</A>
+<H2>HINTS</H2>
+
+You can use <B>pnmquant</B> to color quantize the result, i.e. to
+reduce the number of distinct colors in the image.  In fact, you may
+have to if you want to convert the PPM file to certain other formats.
+<B>ppmdither</B> Does a more sophisticated quantization.
+
+<p>Use <B>pamscale</B> to change the dimensions of the resulting
+image.
+
+<P>Use <B>ppmtopgm </B> to convert a color JFIF file to a grayscale
+PGM file.
+
+<P>You can easily use these converters together.  E.g.:
+
+<PRE>
+    jpegtopnm foo.jpg | ppmtopgm | pamscale .25 &gt;foo.pgm
+</PRE>
+
+<P><B>-dct fast</B> and/or <B>-nosmooth</B> gain speed at a small
+sacrifice in quality.
+
+<P>If you are fortunate enough to have very fast floating point
+hardware, <B>-dct float</B> may be even faster than <B>-dct fast</B>.
+But on most machines <B>-dct float</B> is slower than <B>-dct int</B>;
+in this case it is not worth using, because its theoretical accuracy
+advantage is too small to be significant in practice.
+
+<P>Another program, <B>djpeg</B>, is similar.  <B>djpeg</B> is
+maintained by the Independent JPEG Group and packaged with the JPEG
+library which <B>jpegtopnm</B> uses for all its JPEG work.  Because of
+that, you may expect it to exploit more current JPEG features.  Also,
+since you have to have the library to run <B>jpegtopnm</B>, but not
+vice versa, <B>cjpeg</B> may be more commonly available.
+
+<P>On the other hand, <B>djpeg</B> does not use the NetPBM libraries
+to generate its output, as all the NetPBM tools such as
+<B>jpegtopnm</B> do.  This means it is less likely to be consistent
+with all the other programs that deal with the NetPBM formats.  Also,
+the command syntax of <B>jpegtopnm</B> is consistent with that of the
+other Netpbm tools, unlike <B>djpeg</B>.
+
+<A NAME="lbAH">&nbsp;</A>
+<H2>ENVIRONMENT</H2>
+
+<DL COMPACT>
+<DT><B>JPEGMEM</B>
+
+<DD>If this environment variable is set, its value is the default
+memory limit.  The value is specified as described for the
+<B>-maxmemory</B> option.  An explicit <B>-maxmemory </B> option
+overrides any <B>JPEGMEM</B>.
+
+</DL>
+
+<A NAME="lbAI">&nbsp;</A>
+<H2>SEE ALSO</H2>
+
+<p>
+<B><A HREF="ppm.html">ppm</A></B>,
+<B><A HREF="pgm.html">pgm</A></B>,
+<B><A HREF="pnmtojpeg.html">pnmtojpeg</A></B>,
+<B><A HREF="pnmquant.html">pnmquant</A></B>,
+<B><A HREF="pamscale.html">pamscale</A></B>,
+<B><A HREF="ppmtopgm.html">ppmtopgm</A></B>,
+<B><A HREF="ppmdither.html">ppmdither</A></B>,
+<B><A HREF="pamdepth.html">pamdepth</A></B>,
+
+<p>
+<B>djpeg</B> man page,
+<B>cjpeg</B> man page,
+<B>jpegtran</B> man page,
+<B>rdjpgcom</B> man page,
+<B>wrjpgcom</B> man page,
+<B>jhead</B> man page
+
+<p>Wallace, Gregory K.  &quot;The JPEG Still Picture Compression
+Standard&quot;, Communications of the ACM, April 1991 (vol. 34,
+no. 4), pp. 30-44.
+
+<A NAME="lbAJ">&nbsp;</A>
+<H2>LIMITATIONS</H2>
+
+<p>Arithmetic coding is not offered for legal reasons.  The program
+could be much faster.
+
+<A NAME="lbAK">&nbsp;</A>
+<H2>AUTHOR</H2>
+
+<p><B>jpegtopnm</B> and this manual were derived in large part from
+<B>djpeg</B>, by the Independent JPEG Group.  The program is otherwise
+by Bryan Henderson on March 19, 2000.
+
+<HR>
+<A NAME="index">&nbsp;</A><H2>Table Of Contents</H2>
+<UL>
+<LI><A HREF="#lbAB">NAME</A>
+<LI><A HREF="#lbAC">SYNOPSIS</A>
+<LI><A HREF="#description">DESCRIPTION</A>
+<LI><A HREF="#lbAE">OPTIONS</A>
+<LI><A HREF="#lbAF">EXAMPLES</A>
+<LI><A HREF="#lbAG">HINTS</A>
+<LI><A HREF="#lbAH">ENVIRONMENT</A>
+<LI><A HREF="#lbAI">SEE ALSO</A>
+<LI><A HREF="#lbAJ">LIMITATIONS</A>
+<LI><A HREF="#lbAK">AUTHOR</A>
+</UL>
+</BODY>
+</HTML>