blob: c882ffb75905a2824273cf8cd727ed3b92aed86d [file] [log] [blame]
Thomas G. Lane2cbeb8a1991-10-07 00:00:00 +00001The Independent JPEG Group's JPEG software
2==========================================
3
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +00004README for release 5 of 24-Sep-94
5=================================
Thomas G. Lane2cbeb8a1991-10-07 00:00:00 +00006
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +00007This distribution contains the fifth public release of the Independent JPEG
Thomas G. Lane2cbeb8a1991-10-07 00:00:00 +00008Group's free JPEG software. You are welcome to redistribute this software and
9to use it for any purpose, subject to the conditions under LEGAL ISSUES, below.
10
Thomas G. Lane88aeed41992-12-10 00:00:00 +000011Serious users of this software (particularly those incorporating it into
12larger programs) should contact jpeg-info@uunet.uu.net to be added to our
13electronic mailing list. Mailing list members are notified of updates and
14have a chance to participate in technical discussions, etc.
Thomas G. Lane2cbeb8a1991-10-07 00:00:00 +000015
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +000016This software is the work of Tom Lane, Philip Gladstone, Luis Ortiz, Jim
17Boucher, Lee Crocker, George Phillips, Davide Rossi, Ge' Weijers, and other
18members of the Independent JPEG Group.
19
20IJG is not associated with the official ISO JPEG standards committee.
Thomas G. Lane2cbeb8a1991-10-07 00:00:00 +000021
22
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +000023DOCUMENTATION ROADMAP
24=====================
Thomas G. Lane2cbeb8a1991-10-07 00:00:00 +000025
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +000026This file contains the following sections:
Thomas G. Lane2cbeb8a1991-10-07 00:00:00 +000027
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +000028OVERVIEW General description of JPEG and the IJG software.
29LEGAL ISSUES Copyright, lack of warranty, terms of distribution.
30REFERENCES Where to learn more about JPEG.
31ARCHIVE LOCATIONS Where to find newer versions of this software.
32RELATED SOFTWARE Other stuff you should get.
33FILE FORMAT WARS Software *not* to get.
34TO DO Plans for future IJG releases.
35
36Other documentation files in the distribution are:
37
38User documentation:
39 install.doc How to configure and install the IJG software.
40 usage.doc Usage instructions for cjpeg, djpeg, rdjpgcom, wrjpgcom.
41 *.1 Unix-style man pages for programs (same info as usage.doc).
42 change.log Version-to-version change highlights.
43Programmer and internal documentation:
44 libjpeg.doc How to use the JPEG library in your own programs.
45 example.c Sample code for calling the JPEG library.
46 structure.doc Overview of the JPEG library's internal structure.
47 filelist.doc Road map of IJG files.
48 coderules.doc Coding style rules --- please read if you contribute code.
49
50Please read at least the files install.doc and usage.doc. Useful information
51can also be found in the JPEG FAQ (Frequently Asked Questions) article. See
52ARCHIVE LOCATIONS below to find out where to obtain the FAQ article.
53
54If you want to understand how the JPEG code works, we suggest reading one or
55more of the REFERENCES, then looking at the documentation files (in roughly
56the order listed) before diving into the code.
Thomas G. Lanebd543f01991-12-13 00:00:00 +000057
Thomas G. Lane2cbeb8a1991-10-07 00:00:00 +000058
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +000059OVERVIEW
60========
Thomas G. Lane2cbeb8a1991-10-07 00:00:00 +000061
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +000062This package contains C software to implement JPEG image compression and
Thomas G. Lanebd543f01991-12-13 00:00:00 +000063decompression. JPEG (pronounced "jay-peg") is a standardized compression
Thomas G. Lane88aeed41992-12-10 00:00:00 +000064method for full-color and gray-scale images. JPEG is intended for compressing
Thomas G. Lanebd543f01991-12-13 00:00:00 +000065"real-world" scenes; cartoons and other non-realistic images are not its
66strong suit. JPEG is lossy, meaning that the output image is not necessarily
Thomas G. Lane88aeed41992-12-10 00:00:00 +000067identical to the input image. Hence you must not use JPEG if you have to have
68identical output bits. However, on typical images of real-world scenes, very
69good compression levels can be obtained with no visible change, and amazingly
70high compression levels are possible if you can tolerate a low-quality image.
71For more details, see the references, or just experiment with various
72compression settings.
Thomas G. Lane2cbeb8a1991-10-07 00:00:00 +000073
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +000074We provide a set of library routines for reading and writing JPEG image files,
75plus two simple applications "cjpeg" and "djpeg", which use the library to
76perform conversion between JPEG and some other popular image file formats.
77The library is intended to be reused in other applications.
78
79This software implements JPEG baseline and extended-sequential compression
Thomas G. Lane2cbeb8a1991-10-07 00:00:00 +000080processes. Provision is made for supporting all variants of these processes,
81although some uncommon parameter settings aren't implemented yet. For legal
82reasons, we are not distributing code for the arithmetic-coding process; see
83LEGAL ISSUES. At present we have made no provision for supporting the
Thomas G. Lane4a6b7301992-03-17 00:00:00 +000084progressive, hierarchical, or lossless processes defined in the standard.
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +000085(Support for progressive mode may be offered in a future release.)
Thomas G. Lane2cbeb8a1991-10-07 00:00:00 +000086
Thomas G. Lane88aeed41992-12-10 00:00:00 +000087In order to support file conversion and viewing software, we have included
88considerable functionality beyond the bare JPEG coding/decoding capability;
89for example, the color quantization modules are not strictly part of JPEG
90decoding, but they are essential for output to colormapped file formats or
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +000091colormapped displays. These extra functions can be compiled out of the
92library if not required for a particular application. We have also included
93two simple applications for inserting and extracting textual comments in
94JFIF files.
Thomas G. Lane2cbeb8a1991-10-07 00:00:00 +000095
96The emphasis in designing this software has been on achieving portability and
Thomas G. Lane88aeed41992-12-10 00:00:00 +000097flexibility, while also making it fast enough to be useful. In particular,
98the software is not intended to be read as a tutorial on JPEG. (See the
99REFERENCES section for introductory material.) While we hope that the entire
100package will someday be industrial-strength code, much remains to be done in
101performance tuning and in improving the capabilities of individual modules.
Thomas G. Lane2cbeb8a1991-10-07 00:00:00 +0000102
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000103We welcome the use of this software as a component of commercial products.
104No royalty is required, but we do ask for an acknowledgement in product
105documentation, as described under LEGAL ISSUES.
Thomas G. Lane2cbeb8a1991-10-07 00:00:00 +0000106
107
Thomas G. Lane2cbeb8a1991-10-07 00:00:00 +0000108LEGAL ISSUES
109============
110
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000111In plain English:
112
1131. We don't promise that this software works. (But if you find any bugs,
114 please let us know!)
1152. You can use this software for whatever you want. You don't have to pay us.
1163. You may not pretend that you wrote this software. If you use it in a
117 program, you must acknowledge somewhere in your documentation that
118 you've used the IJG code.
119
120In legalese:
121
Thomas G. Lane2cbeb8a1991-10-07 00:00:00 +0000122The authors make NO WARRANTY or representation, either express or implied,
123with respect to this software, its quality, accuracy, merchantability, or
124fitness for a particular purpose. This software is provided "AS IS", and you,
125its user, assume the entire risk as to its quality and accuracy.
126
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000127This software is copyright (C) 1991, 1992, 1993, 1994, Thomas G. Lane.
Thomas G. Lane2cbeb8a1991-10-07 00:00:00 +0000128All Rights Reserved except as specified below.
129
130Permission is hereby granted to use, copy, modify, and distribute this
131software (or portions thereof) for any purpose, without fee, subject to these
132conditions:
133(1) If any part of the source code for this software is distributed, then this
134README file must be included, with this copyright and no-warranty notice
135unaltered; and any additions, deletions, or changes to the original files
136must be clearly indicated in accompanying documentation.
137(2) If only executable code is distributed, then the accompanying
138documentation must state that "this software is based in part on the work of
139the Independent JPEG Group".
140(3) Permission for use of this software is granted only if the user accepts
141full responsibility for any undesirable consequences; the authors accept
142NO LIABILITY for damages of any kind.
143
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000144These conditions apply to any software derived from or based on the IJG code,
145not just to the unmodified library. If you use our work, you ought to
146acknowledge us.
147
Thomas G. Lane88aeed41992-12-10 00:00:00 +0000148Permission is NOT granted for the use of any IJG author's name or company name
149in advertising or publicity relating to this software or products derived from
150it. This software may be referred to only as "the Independent JPEG Group's
151software".
Thomas G. Lane2cbeb8a1991-10-07 00:00:00 +0000152
153We specifically permit and encourage the use of this software as the basis of
154commercial products, provided that all warranty or liability claims are
155assumed by the product vendor.
156
157
158ansi2knr.c is included in this distribution by permission of L. Peter Deutsch,
159sole proprietor of its copyright holder, Aladdin Enterprises of Menlo Park, CA.
160ansi2knr.c is NOT covered by the above copyright and conditions, but instead
161by the usual distribution terms of the Free Software Foundation; principally,
162that you must include source code if you redistribute it. (See the file
163ansi2knr.c for full details.) However, since ansi2knr.c is not needed as part
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000164of any program generated from the IJG code, this does not limit you more than
Thomas G. Lane2cbeb8a1991-10-07 00:00:00 +0000165the foregoing paragraphs do.
166
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000167The configuration script "configure" was produced by GNU Autoconf. Again,
168the FSF copyright terms apply only to configure, not to the IJG code; and
169again, that does not limit your use of the object code.
Thomas G. Lane2cbeb8a1991-10-07 00:00:00 +0000170
171It appears that the arithmetic coding option of the JPEG spec is covered by
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000172patents owned by IBM, AT&T, and Mitsubishi. Hence arithmetic coding cannot
173legally be used without obtaining one or more licenses. For this reason,
174support for arithmetic coding has been removed from the free JPEG software.
175(Since arithmetic coding provides only a marginal gain over the unpatented
176Huffman mode, it is unlikely that very many implementations will support it.)
Thomas G. Lanebd543f01991-12-13 00:00:00 +0000177So far as we are aware, there are no patent restrictions on the remaining
178code.
179
Thomas G. Lanebd543f01991-12-13 00:00:00 +0000180We are required to state that
181 "The Graphics Interchange Format(c) is the Copyright property of
182 CompuServe Incorporated. GIF(sm) is a Service Mark property of
183 CompuServe Incorporated."
Thomas G. Lane2cbeb8a1991-10-07 00:00:00 +0000184
185
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000186REFERENCES
187==========
188
189We highly recommend reading one or more of these references before trying to
190understand the innards of the JPEG software.
191
192The best short technical introduction to the JPEG compression algorithm is
193 Wallace, Gregory K. "The JPEG Still Picture Compression Standard",
194 Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44.
195(Adjacent articles in that issue discuss MPEG motion picture compression,
196applications of JPEG, and related topics.) If you don't have the CACM issue
197handy, a PostScript file containing a revised version of Wallace's article is
198available at ftp.uu.net, graphics/jpeg/wallace.ps.gz. The file (actually a
199preprint for an article to appear in IEEE Trans. Consumer Electronics) omits
200the sample images that appeared in CACM, but it includes corrections and some
201added material. Note: the Wallace article is copyright ACM and IEEE, and it
202may not be used for commercial purposes.
203
204A somewhat less technical, more leisurely introduction to JPEG can be found in
205"The Data Compression Book" by Mark Nelson, published by M&T Books (Redwood
206City, CA), 1991, ISBN 1-55851-216-0. This book provides good explanations and
207example C code for a multitude of compression methods including JPEG. It is
208an excellent source if you are comfortable reading C code but don't know much
209about data compression in general. The book's JPEG sample code is far from
210industrial-strength, but when you are ready to look at a full implementation,
211you've got one here...
212
213The best full description of JPEG is the textbook "JPEG Still Image Data
214Compression Standard" by William B. Pennebaker and Joan L. Mitchell, published
215by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1. Price US$59.95, 638 pp.
216The book includes the complete text of the ISO JPEG standards (DIS 10918-1
217and draft DIS 10918-2). This is by far the most complete exposition of JPEG
218in existence, and we highly recommend it.
219
220The JPEG standard itself is not available electronically; you must order a
221paper copy through ISO. (Unless you feel a need to own a certified official
222copy, we recommend buying the Pennebaker and Mitchell book instead; it's much
223cheaper and includes a great deal of useful explanatory material.) In the US,
224copies of the standard may be ordered from ANSI Sales at (212) 642-4900, or
225from Global Engineering Documents at (800) 854-7179. (ANSI doesn't take
226credit card orders, but Global does.) It's not cheap: as of 1992, ANSI was
227charging $95 for Part 1 and $47 for Part 2, plus 7% shipping/handling. The
228standard is divided into two parts, Part 1 being the actual specification,
229while Part 2 covers compliance testing methods. Part 1 is titled "Digital
230Compression and Coding of Continuous-tone Still Images, Part 1: Requirements
231and guidelines" and has document number ISO/IEC IS 10918-1. As of mid-1994,
232Part 2 is still at Draft International Standard status. It is titled "Digital
233Compression and Coding of Continuous-tone Still Images, Part 2: Compliance
234testing" and has document number ISO/IEC DIS 10918-2. (The document number
235will change to IS 10918-2 when final approval is obtained.) A Part 3,
236covering extensions, is likely to appear in draft form in late 1994.
237
238The JPEG standard does not specify all details of an interchangeable file
239format. For the omitted details we follow the "JFIF" conventions, revision
2401.02. A copy of the JFIF spec is available from:
241 Literature Department
242 C-Cube Microsystems, Inc.
243 1778 McCarthy Blvd.
244 Milpitas, CA 95035
245 phone (408) 944-6300, fax (408) 944-6314
246A PostScript version of this document is available at ftp.uu.net, file
247graphics/jpeg/jfif.ps.gz. It can also be obtained by e-mail from the C-Cube
248mail server, netlib@c3.pla.ca.us. Send the message "send jfif_ps from jpeg"
249to the server to obtain the JFIF document; send the message "help" if you have
250trouble.
251
252The TIFF 6.0 file format specification can be obtained by FTP from sgi.com
253(192.48.153.1), file graphics/tiff/TIFF6.ps.Z; or you can order a printed copy
254from Aldus Corp. at (206) 628-6593. It should be noted that the TIFF 6.0 spec
255of 3-June-92 has a number of serious problems in its JPEG features. A
256redesign effort is currently underway to correct these problems; it is
257expected to result in a new, incompatible, spec. IJG intends to support the
258corrected version of TIFF when the new spec is issued.
259
260
261ARCHIVE LOCATIONS
262=================
263
264The "official" archive site for this software is ftp.uu.net (Internet
265address 192.48.96.9). The most recent released version can always be found
266there in directory graphics/jpeg. This particular version will be archived
267as graphics/jpeg/jpegsrc.v5.tar.gz. If you are on the Internet, you
268can retrieve files from ftp.uu.net by standard anonymous FTP. If you don't
269have FTP access, UUNET's archives are also available via UUCP; contact
270help@uunet.uu.net for information on retrieving files that way.
271
272Numerous Internet sites maintain copies of the UUNET files; in particular,
273you can probably find a copy at any site that archives comp.sources.misc
274submissions. However, only ftp.uu.net is guaranteed to have the latest
275official version.
276
277You can also obtain this software from CompuServe, in the GRAPHSUPPORT forum
278(GO GRAPHSUP); this version will be file jpsrc5.zip in library 15. Again,
279CompuServe is not guaranteed to have the very latest version.
280
281The JPEG FAQ (Frequently Asked Questions) article is a useful source of
282general information about JPEG. It is updated constantly and therefore
283is not included in this distribution. The FAQ is posted every two weeks
284to Usenet newsgroups comp.graphics, news.answers, and other groups. You
285can always obtain the latest version from the news.answers archive at
286rtfm.mit.edu (18.181.0.24). By FTP, fetch /pub/usenet/news.answers/jpeg-faq.
287If you don't have FTP, send e-mail to mail-server@rtfm.mit.edu with body
288"send usenet/news.answers/jpeg-faq".
289
290
291RELATED SOFTWARE
292================
293
294Numerous viewing and image manipulation programs now support JPEG. (Quite a
295few of them use this library to do so.) The JPEG FAQ described above lists
296some of the more popular free and shareware viewers, and tells where to
297obtain them on Internet.
298
299If you are on a Unix machine, we highly recommend Jef Poskanzer's free
300PBMPLUS image software, which provides many useful operations on PPM-format
301image files. In particular, it can convert PPM images to and from a wide
302range of other formats. You can obtain this package by FTP from ftp.x.org
303(contrib/pbmplus*.tar.Z) or ftp.ee.lbl.gov (pbmplus*.tar.Z). There is also
304a newer update of this package called NETPBM, available from
305wuarchive.wustl.edu under directory /graphics/graphics/packages/NetPBM/.
306Unfortunately PBMPLUS/NETPBM is not nearly as portable as the IJG software
307is; you are likely to have difficulty making it work on any non-Unix machine.
308
309A different free JPEG implementation, written by the PVRG group at Stanford,
310is available from havefun.stanford.edu in directory pub/jpeg. This program
311is designed for research and experimentation rather than production use;
312it is slower, harder to use, and less portable than the IJG code, but it
313implements a larger subset of the JPEG standard. In particular, it supports
314lossless JPEG.
315
316
317FILE FORMAT WARS
318================
319
320Some JPEG programs produce files that are not compatible with our library.
321The root of the problem is that the ISO JPEG committee failed to specify a
322concrete file format. Some vendors "filled in the blanks" on their own,
323creating proprietary formats that no one else could read. (For example, none
324of the early commercial JPEG implementations for the Macintosh were able to
325exchange compressed files.)
326
327The file format we have adopted is called JFIF (see REFERENCES). This format
328has been agreed to by a number of major commercial JPEG vendors, and it has
329become the de facto standard. JFIF is a minimal or "low end" representation.
330Work is also going forward to incorporate JPEG compression into the TIFF
331standard, for use in "high end" applications that need to record a lot of
332additional data about an image. We intend to support TIFF in the future.
333We hope that these two formats will be sufficient and that other,
334incompatible JPEG file formats will not proliferate.
335
336Indeed, part of the reason for developing and releasing this free software is
337to help force rapid convergence to de facto standards for JPEG file formats.
338SUPPORT STANDARD, NON-PROPRIETARY FORMATS: demand JFIF or TIFF/JPEG!
339
340
Thomas G. Lane2cbeb8a1991-10-07 00:00:00 +0000341TO DO
342=====
343
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000344In future versions, we are considering supporting progressive JPEG
345compression, the upcoming JPEG Part 3 extensions, and other improvements.
Thomas G. Lane88aeed41992-12-10 00:00:00 +0000346
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000347As always, speeding things up is high on our priority list.
Thomas G. Lane2cbeb8a1991-10-07 00:00:00 +0000348
349Please send bug reports, offers of help, etc. to jpeg-info@uunet.uu.net.