1402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollThe Independent JPEG Group's JPEG software
2402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll==========================================
3402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
4402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollREADME for release 6b of 27-Mar-1998
5402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll====================================
6402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
7402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollThis distribution contains the sixth public release of the Independent JPEG
8402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollGroup's free JPEG software.  You are welcome to redistribute this software and
9402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollto use it for any purpose, subject to the conditions under LEGAL ISSUES, below.
10402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
11402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollSerious users of this software (particularly those incorporating it into
12402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Molllarger programs) should contact IJG at jpeg-info@uunet.uu.net to be added to
13402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollour electronic mailing list.  Mailing list members are notified of updates
14402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Molland have a chance to participate in technical discussions, etc.
15402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
16402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollThis software is the work of Tom Lane, Philip Gladstone, Jim Boucher,
17402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollLee Crocker, Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi,
18402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollGuido Vollbeding, Ge' Weijers, and other members of the Independent JPEG
19402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollGroup.
20402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
21402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollIJG is not affiliated with the official ISO JPEG standards committee.
22402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
23402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
24402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollDOCUMENTATION ROADMAP
25402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll=====================
26402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
27402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollThis file contains the following sections:
28402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
29402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollOVERVIEW            General description of JPEG and the IJG software.
30402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollLEGAL ISSUES        Copyright, lack of warranty, terms of distribution.
31402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollREFERENCES          Where to learn more about JPEG.
32402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollARCHIVE LOCATIONS   Where to find newer versions of this software.
33402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollRELATED SOFTWARE    Other stuff you should get.
34402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollFILE FORMAT WARS    Software *not* to get.
35402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollTO DO               Plans for future IJG releases.
36402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
37402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollOther documentation files in the distribution are:
38402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
39402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollUser documentation:
40402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll  install.doc       How to configure and install the IJG software.
41402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll  usage.doc         Usage instructions for cjpeg, djpeg, jpegtran,
42402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll                    rdjpgcom, and wrjpgcom.
43402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll  *.1               Unix-style man pages for programs (same info as usage.doc).
44402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll  wizard.doc        Advanced usage instructions for JPEG wizards only.
45402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll  change.log        Version-to-version change highlights.
46402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollProgrammer and internal documentation:
47402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll  libjpeg.doc       How to use the JPEG library in your own programs.
48402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll  example.c         Sample code for calling the JPEG library.
49402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll  structure.doc     Overview of the JPEG library's internal structure.
50402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll  filelist.doc      Road map of IJG files.
51402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll  coderules.doc     Coding style rules --- please read if you contribute code.
52402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
53402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollPlease read at least the files install.doc and usage.doc.  Useful information
54402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollcan also be found in the JPEG FAQ (Frequently Asked Questions) article.  See
55402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollARCHIVE LOCATIONS below to find out where to obtain the FAQ article.
56402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
57402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollIf you want to understand how the JPEG code works, we suggest reading one or
58402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollmore of the REFERENCES, then looking at the documentation files (in roughly
59402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollthe order listed) before diving into the code.
60402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
61402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
62402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollOVERVIEW
63402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll========
64402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
65402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollThis package contains C software to implement JPEG image compression and
66402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Molldecompression.  JPEG (pronounced "jay-peg") is a standardized compression
67402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollmethod for full-color and gray-scale images.  JPEG is intended for compressing
68402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll"real-world" scenes; line drawings, cartoons and other non-realistic images
69402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollare not its strong suit.  JPEG is lossy, meaning that the output image is not
70402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollexactly identical to the input image.  Hence you must not use JPEG if you
71402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollhave to have identical output bits.  However, on typical photographic images,
72402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollvery good compression levels can be obtained with no visible change, and
73402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollremarkably high compression levels are possible if you can tolerate a
74402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Molllow-quality image.  For more details, see the references, or just experiment
75402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollwith various compression settings.
76402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
77402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollThis software implements JPEG baseline, extended-sequential, and progressive
78402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollcompression processes.  Provision is made for supporting all variants of these
79402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollprocesses, although some uncommon parameter settings aren't implemented yet.
80402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollFor legal reasons, we are not distributing code for the arithmetic-coding
81402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollvariants of JPEG; see LEGAL ISSUES.  We have made no provision for supporting
82402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollthe hierarchical or lossless processes defined in the standard.
83402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
84402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollWe provide a set of library routines for reading and writing JPEG image files,
85402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollplus two sample applications "cjpeg" and "djpeg", which use the library to
86402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollperform conversion between JPEG and some other popular image file formats.
87402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollThe library is intended to be reused in other applications.
88402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
89402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollIn order to support file conversion and viewing software, we have included
90402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollconsiderable functionality beyond the bare JPEG coding/decoding capability;
91402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollfor example, the color quantization modules are not strictly part of JPEG
92402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Molldecoding, but they are essential for output to colormapped file formats or
93402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollcolormapped displays.  These extra functions can be compiled out of the
94402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Molllibrary if not required for a particular application.  We have also included
95402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll"jpegtran", a utility for lossless transcoding between different JPEG
96402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollprocesses, and "rdjpgcom" and "wrjpgcom", two simple applications for
97402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollinserting and extracting textual comments in JFIF files.
98402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
99402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollThe emphasis in designing this software has been on achieving portability and
100402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollflexibility, while also making it fast enough to be useful.  In particular,
101402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollthe software is not intended to be read as a tutorial on JPEG.  (See the
102402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollREFERENCES section for introductory material.)  Rather, it is intended to
103402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollbe reliable, portable, industrial-strength code.  We do not claim to have
104402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollachieved that goal in every aspect of the software, but we strive for it.
105402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
106402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollWe welcome the use of this software as a component of commercial products.
107402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollNo royalty is required, but we do ask for an acknowledgement in product
108402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Molldocumentation, as described under LEGAL ISSUES.
109402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
110402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
111402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollLEGAL ISSUES
112402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll============
113402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
114402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollIn plain English:
115402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
116402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll1. We don't promise that this software works.  (But if you find any bugs,
117402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll   please let us know!)
118402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll2. You can use this software for whatever you want.  You don't have to pay us.
119402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll3. You may not pretend that you wrote this software.  If you use it in a
120402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll   program, you must acknowledge somewhere in your documentation that
121402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll   you've used the IJG code.
122402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
123402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollIn legalese:
124402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
125402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollThe authors make NO WARRANTY or representation, either express or implied,
126402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollwith respect to this software, its quality, accuracy, merchantability, or
127402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollfitness for a particular purpose.  This software is provided "AS IS", and you,
128402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollits user, assume the entire risk as to its quality and accuracy.
129402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
130402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollThis software is copyright (C) 1991-1998, Thomas G. Lane.
131402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollAll Rights Reserved except as specified below.
132402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
133402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollPermission is hereby granted to use, copy, modify, and distribute this
134402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollsoftware (or portions thereof) for any purpose, without fee, subject to these
135402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollconditions:
136402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll(1) If any part of the source code for this software is distributed, then this
137402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollREADME file must be included, with this copyright and no-warranty notice
138402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollunaltered; and any additions, deletions, or changes to the original files
139402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollmust be clearly indicated in accompanying documentation.
140402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll(2) If only executable code is distributed, then the accompanying
141402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Molldocumentation must state that "this software is based in part on the work of
142402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollthe Independent JPEG Group".
143402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll(3) Permission for use of this software is granted only if the user accepts
144402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollfull responsibility for any undesirable consequences; the authors accept
145402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollNO LIABILITY for damages of any kind.
146402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
147402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollThese conditions apply to any software derived from or based on the IJG code,
148402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollnot just to the unmodified library.  If you use our work, you ought to
149402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollacknowledge us.
150402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
151402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollPermission is NOT granted for the use of any IJG author's name or company name
152402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollin advertising or publicity relating to this software or products derived from
153402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollit.  This software may be referred to only as "the Independent JPEG Group's
154402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollsoftware".
155402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
156402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollWe specifically permit and encourage the use of this software as the basis of
157402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollcommercial products, provided that all warranty or liability claims are
158402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollassumed by the product vendor.
159402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
160402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
161402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollansi2knr.c is included in this distribution by permission of L. Peter Deutsch,
162402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollsole proprietor of its copyright holder, Aladdin Enterprises of Menlo Park, CA.
163402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollansi2knr.c is NOT covered by the above copyright and conditions, but instead
164402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollby the usual distribution terms of the Free Software Foundation; principally,
165402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollthat you must include source code if you redistribute it.  (See the file
166402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollansi2knr.c for full details.)  However, since ansi2knr.c is not needed as part
167402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollof any program generated from the IJG code, this does not limit you more than
168402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollthe foregoing paragraphs do.
169402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
170402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollThe Unix configuration script "configure" was produced with GNU Autoconf.
171402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollIt is copyright by the Free Software Foundation but is freely distributable.
172402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollThe same holds for its supporting scripts (config.guess, config.sub,
173402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollltconfig, ltmain.sh).  Another support script, install-sh, is copyright
174402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollby M.I.T. but is also freely distributable.
175402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
176402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollIt appears that the arithmetic coding option of the JPEG spec is covered by
177402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollpatents owned by IBM, AT&T, and Mitsubishi.  Hence arithmetic coding cannot
178402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Molllegally be used without obtaining one or more licenses.  For this reason,
179402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollsupport for arithmetic coding has been removed from the free JPEG software.
180402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll(Since arithmetic coding provides only a marginal gain over the unpatented
181402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollHuffman mode, it is unlikely that very many implementations will support it.)
182402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollSo far as we are aware, there are no patent restrictions on the remaining
183402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollcode.
184402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
185402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollThe IJG distribution formerly included code to read and write GIF files.
186402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollTo avoid entanglement with the Unisys LZW patent, GIF reading support has
187402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollbeen removed altogether, and the GIF writer has been simplified to produce
188402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll"uncompressed GIFs".  This technique does not use the LZW algorithm; the
189402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollresulting GIF files are larger than usual, but are readable by all standard
190402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollGIF decoders.
191402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
192402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollWe are required to state that
193402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll    "The Graphics Interchange Format(c) is the Copyright property of
194402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll    CompuServe Incorporated.  GIF(sm) is a Service Mark property of
195402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll    CompuServe Incorporated."
196402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
197402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
198402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollREFERENCES
199402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll==========
200402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
201402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollWe highly recommend reading one or more of these references before trying to
202402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollunderstand the innards of the JPEG software.
203402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
204402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollThe best short technical introduction to the JPEG compression algorithm is
205402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll	Wallace, Gregory K.  "The JPEG Still Picture Compression Standard",
206402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll	Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44.
207402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll(Adjacent articles in that issue discuss MPEG motion picture compression,
208402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollapplications of JPEG, and related topics.)  If you don't have the CACM issue
209402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollhandy, a PostScript file containing a revised version of Wallace's article is
210402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollavailable at ftp://ftp.uu.net/graphics/jpeg/wallace.ps.gz.  The file (actually
211402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Molla preprint for an article that appeared in IEEE Trans. Consumer Electronics)
212402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollomits the sample images that appeared in CACM, but it includes corrections
213402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Molland some added material.  Note: the Wallace article is copyright ACM and IEEE,
214402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Molland it may not be used for commercial purposes.
215402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
216402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollA somewhat less technical, more leisurely introduction to JPEG can be found in
217402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll"The Data Compression Book" by Mark Nelson and Jean-loup Gailly, published by
218402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollM&T Books (New York), 2nd ed. 1996, ISBN 1-55851-434-1.  This book provides
219402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollgood explanations and example C code for a multitude of compression methods
220402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollincluding JPEG.  It is an excellent source if you are comfortable reading C
221402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollcode but don't know much about data compression in general.  The book's JPEG
222402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollsample code is far from industrial-strength, but when you are ready to look
223402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollat a full implementation, you've got one here...
224402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
225402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollThe best full description of JPEG is the textbook "JPEG Still Image Data
226402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollCompression Standard" by William B. Pennebaker and Joan L. Mitchell, published
227402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollby Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1.  Price US$59.95, 638 pp.
228402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollThe book includes the complete text of the ISO JPEG standards (DIS 10918-1
229402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Molland draft DIS 10918-2).  This is by far the most complete exposition of JPEG
230402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollin existence, and we highly recommend it.
231402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
232402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollThe JPEG standard itself is not available electronically; you must order a
233402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollpaper copy through ISO or ITU.  (Unless you feel a need to own a certified
234402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollofficial copy, we recommend buying the Pennebaker and Mitchell book instead;
235402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollit's much cheaper and includes a great deal of useful explanatory material.)
236402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollIn the USA, copies of the standard may be ordered from ANSI Sales at (212)
237402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll642-4900, or from Global Engineering Documents at (800) 854-7179.  (ANSI
238402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Molldoesn't take credit card orders, but Global does.)  It's not cheap: as of
239402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll1992, ANSI was charging $95 for Part 1 and $47 for Part 2, plus 7%
240402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollshipping/handling.  The standard is divided into two parts, Part 1 being the
241402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollactual specification, while Part 2 covers compliance testing methods.  Part 1
242402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollis titled "Digital Compression and Coding of Continuous-tone Still Images,
243402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollPart 1: Requirements and guidelines" and has document numbers ISO/IEC IS
244402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll10918-1, ITU-T T.81.  Part 2 is titled "Digital Compression and Coding of
245402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollContinuous-tone Still Images, Part 2: Compliance testing" and has document
246402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollnumbers ISO/IEC IS 10918-2, ITU-T T.83.
247402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
248402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollSome extensions to the original JPEG standard are defined in JPEG Part 3,
249402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Molla newer ISO standard numbered ISO/IEC IS 10918-3 and ITU-T T.84.  IJG
250402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollcurrently does not support any Part 3 extensions.
251402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
252402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollThe JPEG standard does not specify all details of an interchangeable file
253402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollformat.  For the omitted details we follow the "JFIF" conventions, revision
254402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll1.02.  A copy of the JFIF spec is available from:
255402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll	Literature Department
256402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll	C-Cube Microsystems, Inc.
257402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll	1778 McCarthy Blvd.
258402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll	Milpitas, CA 95035
259402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll	phone (408) 944-6300,  fax (408) 944-6314
260402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollA PostScript version of this document is available by FTP at
261402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollftp://ftp.uu.net/graphics/jpeg/jfif.ps.gz.  There is also a plain text
262402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollversion at ftp://ftp.uu.net/graphics/jpeg/jfif.txt.gz, but it is missing
263402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollthe figures.
264402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
265402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollThe TIFF 6.0 file format specification can be obtained by FTP from
266402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz.  The JPEG incorporation scheme
267402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollfound in the TIFF 6.0 spec of 3-June-92 has a number of serious problems.
268402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollIJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6).
269402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollInstead, we recommend the JPEG design proposed by TIFF Technical Note #2
270402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll(Compression tag 7).  Copies of this Note can be obtained from ftp.sgi.com or
271402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollfrom ftp://ftp.uu.net/graphics/jpeg/.  It is expected that the next revision
272402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollof the TIFF spec will replace the 6.0 JPEG design with the Note's design.
273402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollAlthough IJG's own code does not support TIFF/JPEG, the free libtiff library
274402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Molluses our library to implement TIFF/JPEG per the Note.  libtiff is available
275402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollfrom ftp://ftp.sgi.com/graphics/tiff/.
276402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
277402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
278402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollARCHIVE LOCATIONS
279402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll=================
280402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
281402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollThe "official" archive site for this software is ftp.uu.net (Internet
282402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Molladdress 192.48.96.9).  The most recent released version can always be found
283402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollthere in directory graphics/jpeg.  This particular version will be archived
284402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollas ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz.  If you don't have
285402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Molldirect Internet access, UUNET's archives are also available via UUCP; contact
286402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollhelp@uunet.uu.net for information on retrieving files that way.
287402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
288402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollNumerous Internet sites maintain copies of the UUNET files.  However, only
289402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollftp.uu.net is guaranteed to have the latest official version.
290402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
291402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollYou can also obtain this software in DOS-compatible "zip" archive format from
292402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollthe SimTel archives (ftp://ftp.simtel.net/pub/simtelnet/msdos/graphics/), or
293402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollon CompuServe in the Graphics Support forum (GO CIS:GRAPHSUP), library 12
294402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll"JPEG Tools".  Again, these versions may sometimes lag behind the ftp.uu.net
295402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollrelease.
296402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
297402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollThe JPEG FAQ (Frequently Asked Questions) article is a useful source of
298402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollgeneral information about JPEG.  It is updated constantly and therefore is
299402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollnot included in this distribution.  The FAQ is posted every two weeks to
300402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollUsenet newsgroups comp.graphics.misc, news.answers, and other groups.
301402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollIt is available on the World Wide Web at http://www.faqs.org/faqs/jpeg-faq/
302402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Molland other news.answers archive sites, including the official news.answers
303402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollarchive at rtfm.mit.edu: ftp://rtfm.mit.edu/pub/usenet/news.answers/jpeg-faq/.
304402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollIf you don't have Web or FTP access, send e-mail to mail-server@rtfm.mit.edu
305402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollwith body
306402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll	send usenet/news.answers/jpeg-faq/part1
307402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll	send usenet/news.answers/jpeg-faq/part2
308402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
309402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
310402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollRELATED SOFTWARE
311402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll================
312402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
313402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollNumerous viewing and image manipulation programs now support JPEG.  (Quite a
314402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollfew of them use this library to do so.)  The JPEG FAQ described above lists
315402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollsome of the more popular free and shareware viewers, and tells where to
316402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollobtain them on Internet.
317402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
318402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollIf you are on a Unix machine, we highly recommend Jef Poskanzer's free
319402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollPBMPLUS software, which provides many useful operations on PPM-format image
320402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollfiles.  In particular, it can convert PPM images to and from a wide range of
321402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollother formats, thus making cjpeg/djpeg considerably more useful.  The latest
322402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollversion is distributed by the NetPBM group, and is available from numerous
323402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollsites, notably ftp://wuarchive.wustl.edu/graphics/graphics/packages/NetPBM/.
324402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollUnfortunately PBMPLUS/NETPBM is not nearly as portable as the IJG software is;
325402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollyou are likely to have difficulty making it work on any non-Unix machine.
326402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
327402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollA different free JPEG implementation, written by the PVRG group at Stanford,
328402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollis available from ftp://havefun.stanford.edu/pub/jpeg/.  This program
329402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollis designed for research and experimentation rather than production use;
330402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollit is slower, harder to use, and less portable than the IJG code, but it
331402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollis easier to read and modify.  Also, the PVRG code supports lossless JPEG,
332402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollwhich we do not.  (On the other hand, it doesn't do progressive JPEG.)
333402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
334402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
335402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollFILE FORMAT WARS
336402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll================
337402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
338402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollSome JPEG programs produce files that are not compatible with our library.
339402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollThe root of the problem is that the ISO JPEG committee failed to specify a
340402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollconcrete file format.  Some vendors "filled in the blanks" on their own,
341402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollcreating proprietary formats that no one else could read.  (For example, none
342402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollof the early commercial JPEG implementations for the Macintosh were able to
343402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollexchange compressed files.)
344402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
345402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollThe file format we have adopted is called JFIF (see REFERENCES).  This format
346402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollhas been agreed to by a number of major commercial JPEG vendors, and it has
347402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollbecome the de facto standard.  JFIF is a minimal or "low end" representation.
348402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollWe recommend the use of TIFF/JPEG (TIFF revision 6.0 as modified by TIFF
349402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollTechnical Note #2) for "high end" applications that need to record a lot of
350402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Molladditional data about an image.  TIFF/JPEG is fairly new and not yet widely
351402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollsupported, unfortunately.
352402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
353402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollThe upcoming JPEG Part 3 standard defines a file format called SPIFF.
354402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollSPIFF is interoperable with JFIF, in the sense that most JFIF decoders should
355402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollbe able to read the most common variant of SPIFF.  SPIFF has some technical
356402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Molladvantages over JFIF, but its major claim to fame is simply that it is an
357402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollofficial standard rather than an informal one.  At this point it is unclear
358402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollwhether SPIFF will supersede JFIF or whether JFIF will remain the de-facto
359402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollstandard.  IJG intends to support SPIFF once the standard is frozen, but we
360402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollhave not decided whether it should become our default output format or not.
361402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll(In any case, our decoder will remain capable of reading JFIF indefinitely.)
362402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
363402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollVarious proprietary file formats incorporating JPEG compression also exist.
364402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollWe have little or no sympathy for the existence of these formats.  Indeed,
365402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollone of the original reasons for developing this free software was to help
366402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollforce convergence on common, open format standards for JPEG files.  Don't
367402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Molluse a proprietary file format!
368402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
369402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
370402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollTO DO
371402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll=====
372402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
373402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollThe major thrust for v7 will probably be improvement of visual quality.
374402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollThe current method for scaling the quantization tables is known not to be
375402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollvery good at low Q values.  We also intend to investigate block boundary
376402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollsmoothing, "poor man's variable quantization", and other means of improving
377402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollquality-vs-file-size performance without sacrificing compatibility.
378402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
379402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollIn future versions, we are considering supporting some of the upcoming JPEG
380402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollPart 3 extensions --- principally, variable quantization and the SPIFF file
381402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollformat.
382402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
383402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollAs always, speeding things up is of great interest.
384402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll
385402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael MollPlease send bug reports, offers of help, etc. to jpeg-info@uunet.uu.net.
386