blob: daa79611457d75d7da757fa709a3b5bba8a38b74 [file] [log] [blame]
Thomas G. Lane2cbeb8a1991-10-07 00:00:00 +00001The Independent JPEG Group's JPEG software
2==========================================
3
Thomas G. Lane9ba2f5e1994-12-07 00:00:00 +00004README for release 5a of 7-Dec-94
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +00005=================================
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
Thomas G. Lane9ba2f5e1994-12-07 00:00:00 +000012larger programs) should contact IJG at jpeg-info@uunet.uu.net to be added to
13our electronic mailing list. Mailing list members are notified of updates
14and have 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. Lane9ba2f5e1994-12-07 00:00:00 +0000167The configuration script "configure" was produced with GNU Autoconf. It
168is copyright by the Free Software Foundation but is freely distributable.
Thomas G. Lane2cbeb8a1991-10-07 00:00:00 +0000169
170It appears that the arithmetic coding option of the JPEG spec is covered by
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000171patents owned by IBM, AT&T, and Mitsubishi. Hence arithmetic coding cannot
172legally be used without obtaining one or more licenses. For this reason,
173support for arithmetic coding has been removed from the free JPEG software.
174(Since arithmetic coding provides only a marginal gain over the unpatented
175Huffman mode, it is unlikely that very many implementations will support it.)
Thomas G. Lanebd543f01991-12-13 00:00:00 +0000176So far as we are aware, there are no patent restrictions on the remaining
177code.
178
Thomas G. Lanebd543f01991-12-13 00:00:00 +0000179We are required to state that
180 "The Graphics Interchange Format(c) is the Copyright property of
181 CompuServe Incorporated. GIF(sm) is a Service Mark property of
182 CompuServe Incorporated."
Thomas G. Lane2cbeb8a1991-10-07 00:00:00 +0000183
184
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000185REFERENCES
186==========
187
188We highly recommend reading one or more of these references before trying to
189understand the innards of the JPEG software.
190
191The best short technical introduction to the JPEG compression algorithm is
192 Wallace, Gregory K. "The JPEG Still Picture Compression Standard",
193 Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44.
194(Adjacent articles in that issue discuss MPEG motion picture compression,
195applications of JPEG, and related topics.) If you don't have the CACM issue
Thomas G. Lane9ba2f5e1994-12-07 00:00:00 +0000196handy, a PostScript file containing a revised version of Wallace's article
197is available at ftp.uu.net, graphics/jpeg/wallace.ps.gz. The file (actually
198a preprint for an article that appeared in IEEE Trans. Consumer Electronics)
199omits the sample images that appeared in CACM, but it includes corrections
200and some added material. Note: the Wallace article is copyright ACM and
201IEEE, and it may not be used for commercial purposes.
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000202
203A somewhat less technical, more leisurely introduction to JPEG can be found in
204"The Data Compression Book" by Mark Nelson, published by M&T Books (Redwood
205City, CA), 1991, ISBN 1-55851-216-0. This book provides good explanations and
206example C code for a multitude of compression methods including JPEG. It is
207an excellent source if you are comfortable reading C code but don't know much
208about data compression in general. The book's JPEG sample code is far from
209industrial-strength, but when you are ready to look at a full implementation,
210you've got one here...
211
212The best full description of JPEG is the textbook "JPEG Still Image Data
213Compression Standard" by William B. Pennebaker and Joan L. Mitchell, published
214by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1. Price US$59.95, 638 pp.
215The book includes the complete text of the ISO JPEG standards (DIS 10918-1
216and draft DIS 10918-2). This is by far the most complete exposition of JPEG
217in existence, and we highly recommend it.
218
219The JPEG standard itself is not available electronically; you must order a
220paper copy through ISO. (Unless you feel a need to own a certified official
221copy, we recommend buying the Pennebaker and Mitchell book instead; it's much
222cheaper and includes a great deal of useful explanatory material.) In the US,
223copies of the standard may be ordered from ANSI Sales at (212) 642-4900, or
224from Global Engineering Documents at (800) 854-7179. (ANSI doesn't take
225credit card orders, but Global does.) It's not cheap: as of 1992, ANSI was
226charging $95 for Part 1 and $47 for Part 2, plus 7% shipping/handling. The
227standard is divided into two parts, Part 1 being the actual specification,
228while Part 2 covers compliance testing methods. Part 1 is titled "Digital
229Compression and Coding of Continuous-tone Still Images, Part 1: Requirements
230and guidelines" and has document number ISO/IEC IS 10918-1. As of mid-1994,
231Part 2 is still at Draft International Standard status. It is titled "Digital
232Compression and Coding of Continuous-tone Still Images, Part 2: Compliance
233testing" and has document number ISO/IEC DIS 10918-2. (The document number
234will change to IS 10918-2 when final approval is obtained.) A Part 3,
235covering extensions, is likely to appear in draft form in late 1994.
236
237The JPEG standard does not specify all details of an interchangeable file
238format. For the omitted details we follow the "JFIF" conventions, revision
2391.02. A copy of the JFIF spec is available from:
240 Literature Department
241 C-Cube Microsystems, Inc.
242 1778 McCarthy Blvd.
243 Milpitas, CA 95035
244 phone (408) 944-6300, fax (408) 944-6314
245A PostScript version of this document is available at ftp.uu.net, file
246graphics/jpeg/jfif.ps.gz. It can also be obtained by e-mail from the C-Cube
247mail server, netlib@c3.pla.ca.us. Send the message "send jfif_ps from jpeg"
248to the server to obtain the JFIF document; send the message "help" if you have
249trouble.
250
251The TIFF 6.0 file format specification can be obtained by FTP from sgi.com
252(192.48.153.1), file graphics/tiff/TIFF6.ps.Z; or you can order a printed copy
253from Aldus Corp. at (206) 628-6593. It should be noted that the TIFF 6.0 spec
254of 3-June-92 has a number of serious problems in its JPEG features. A
255redesign effort is currently underway to correct these problems; it is
256expected to result in a new, incompatible, spec. IJG intends to support the
257corrected version of TIFF when the new spec is issued.
258
259
260ARCHIVE LOCATIONS
261=================
262
263The "official" archive site for this software is ftp.uu.net (Internet
264address 192.48.96.9). The most recent released version can always be found
265there in directory graphics/jpeg. This particular version will be archived
Thomas G. Lane9ba2f5e1994-12-07 00:00:00 +0000266as graphics/jpeg/jpegsrc.v5a.tar.gz. If you are on the Internet, you
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000267can retrieve files from ftp.uu.net by standard anonymous FTP. If you don't
268have FTP access, UUNET's archives are also available via UUCP; contact
269help@uunet.uu.net for information on retrieving files that way.
270
271Numerous Internet sites maintain copies of the UUNET files; in particular,
272you can probably find a copy at any site that archives comp.sources.misc
273submissions. However, only ftp.uu.net is guaranteed to have the latest
274official version.
275
Thomas G. Lane9ba2f5e1994-12-07 00:00:00 +0000276You can also obtain this software from CompuServe, in the GRAPHSUPPORT
277forum (GO GRAPHSUP), probably in library 15 (there are rumors of a pending
278reorganization there). Again, CompuServe is not guaranteed to have the
279very latest version.
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000280
281The JPEG FAQ (Frequently Asked Questions) article is a useful source of
Thomas G. Lane9ba2f5e1994-12-07 00:00:00 +0000282general information about JPEG. It is updated constantly and therefore is
283not included in this distribution. The FAQ is posted every two weeks to
284Usenet newsgroups comp.graphics, news.answers, and other groups. You can
285always obtain the latest version from the news.answers archive at
286rtfm.mit.edu. By FTP, fetch /pub/usenet/news.answers/jpeg-faq/part1 and
287.../part2. If you don't have FTP, send e-mail to mail-server@rtfm.mit.edu
288with body
289 send usenet/news.answers/jpeg-faq/part1
290 send usenet/news.answers/jpeg-faq/part2
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000291
292
293RELATED SOFTWARE
294================
295
296Numerous viewing and image manipulation programs now support JPEG. (Quite a
297few of them use this library to do so.) The JPEG FAQ described above lists
298some of the more popular free and shareware viewers, and tells where to
299obtain them on Internet.
300
301If you are on a Unix machine, we highly recommend Jef Poskanzer's free
302PBMPLUS image software, which provides many useful operations on PPM-format
303image files. In particular, it can convert PPM images to and from a wide
304range of other formats. You can obtain this package by FTP from ftp.x.org
305(contrib/pbmplus*.tar.Z) or ftp.ee.lbl.gov (pbmplus*.tar.Z). There is also
306a newer update of this package called NETPBM, available from
307wuarchive.wustl.edu under directory /graphics/graphics/packages/NetPBM/.
308Unfortunately PBMPLUS/NETPBM is not nearly as portable as the IJG software
309is; you are likely to have difficulty making it work on any non-Unix machine.
310
311A different free JPEG implementation, written by the PVRG group at Stanford,
312is available from havefun.stanford.edu in directory pub/jpeg. This program
313is designed for research and experimentation rather than production use;
314it is slower, harder to use, and less portable than the IJG code, but it
315implements a larger subset of the JPEG standard. In particular, it supports
316lossless JPEG.
317
318
319FILE FORMAT WARS
320================
321
322Some JPEG programs produce files that are not compatible with our library.
323The root of the problem is that the ISO JPEG committee failed to specify a
324concrete file format. Some vendors "filled in the blanks" on their own,
325creating proprietary formats that no one else could read. (For example, none
326of the early commercial JPEG implementations for the Macintosh were able to
327exchange compressed files.)
328
329The file format we have adopted is called JFIF (see REFERENCES). This format
330has been agreed to by a number of major commercial JPEG vendors, and it has
331become the de facto standard. JFIF is a minimal or "low end" representation.
332Work is also going forward to incorporate JPEG compression into the TIFF
333standard, for use in "high end" applications that need to record a lot of
334additional data about an image. We intend to support TIFF in the future.
335We hope that these two formats will be sufficient and that other,
336incompatible JPEG file formats will not proliferate.
337
338Indeed, part of the reason for developing and releasing this free software is
339to help force rapid convergence to de facto standards for JPEG file formats.
340SUPPORT STANDARD, NON-PROPRIETARY FORMATS: demand JFIF or TIFF/JPEG!
341
342
Thomas G. Lane2cbeb8a1991-10-07 00:00:00 +0000343TO DO
344=====
345
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000346In future versions, we are considering supporting progressive JPEG
347compression, the upcoming JPEG Part 3 extensions, and other improvements.
Thomas G. Lane88aeed41992-12-10 00:00:00 +0000348
Thomas G. Lane36a4ccc1994-09-24 00:00:00 +0000349As always, speeding things up is high on our priority list.
Thomas G. Lane2cbeb8a1991-10-07 00:00:00 +0000350
351Please send bug reports, offers of help, etc. to jpeg-info@uunet.uu.net.