Debian Codegraph @

converter/other/README.JPEG

raw
1 THIS IS THE README FILE FROM THE JPEG LIBRARY, 2000.03.06. IT IS INCLUDED
2 VERBATIM, INCLUDING ITS COPYRIGHT AND LICENSE NOTICES, IN THE NETPBM
3 PACKAGE AS ONE OF THE TERMS UNDER WHICH THE INDEPENDENT JPEG GROUP GRANTED
4 PERMISSION TO BRYAN HENDERSON TODAY TO DISTRIBUTE THE PPMTOJPEG AND
5 JPEGTOPPM COMPONENTS OF NETPBM, WHICH ARE DERIVED FROM THE CJPEG AND DJPEG
6 PROGRAMS IN THE JPEG LIBRARY PACKAGE.
7
8 AS PROVIDED BY THE LICENSE GIVEN TO BRYAN, BRYAN PROPAGATES THE SAME
9 LICENSE TO YOU, WITH RESPECT TO PPMTOJPEG AND JPEGTOPPM.
10
11
12
13 The Independent JPEG Group's JPEG software
14 ==========================================
15
16 README for release 6b of 27-Mar-1998
17 ====================================
18
19 This distribution contains the sixth public release of the Independent JPEG
20 Group's free JPEG software. You are welcome to redistribute this software and
21 to use it for any purpose, subject to the conditions under LEGAL ISSUES, below.
22
23 Serious users of this software (particularly those incorporating it into
24 larger programs) should contact IJG at [email protected] to be added to
25 our electronic mailing list. Mailing list members are notified of updates
26 and have a chance to participate in technical discussions, etc.
27
28 This software is the work of Tom Lane, Philip Gladstone, Jim Boucher,
29 Lee Crocker, Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi,
30 Guido Vollbeding, Ge' Weijers, and other members of the Independent JPEG
31 Group.
32
33 IJG is not affiliated with the official ISO JPEG standards committee.
34
35
36 DOCUMENTATION ROADMAP
37 =====================
38
39 This file contains the following sections:
40
41 OVERVIEW General description of JPEG and the IJG software.
42 LEGAL ISSUES Copyright, lack of warranty, terms of distribution.
43 REFERENCES Where to learn more about JPEG.
44 ARCHIVE LOCATIONS Where to find newer versions of this software.
45 RELATED SOFTWARE Other stuff you should get.
46 FILE FORMAT WARS Software *not* to get.
47 TO DO Plans for future IJG releases.
48
49 Other documentation files in the distribution are:
50
51 User documentation:
52 install.doc How to configure and install the IJG software.
53 usage.doc Usage instructions for cjpeg, djpeg, jpegtran,
54 rdjpgcom, and wrjpgcom.
55 *.1 Unix-style man pages for programs (same info as usage.doc).
56 wizard.doc Advanced usage instructions for JPEG wizards only.
57 change.log Version-to-version change highlights.
58 Programmer and internal documentation:
59 libjpeg.doc How to use the JPEG library in your own programs.
60 example.c Sample code for calling the JPEG library.
61 structure.doc Overview of the JPEG library's internal structure.
62 filelist.doc Road map of IJG files.
63 coderules.doc Coding style rules --- please read if you contribute code.
64
65 Please read at least the files install.doc and usage.doc. Useful information
66 can also be found in the JPEG FAQ (Frequently Asked Questions) article. See
67 ARCHIVE LOCATIONS below to find out where to obtain the FAQ article.
68
69 If you want to understand how the JPEG code works, we suggest reading one or
70 more of the REFERENCES, then looking at the documentation files (in roughly
71 the order listed) before diving into the code.
72
73
74 OVERVIEW
75 ========
76
77 This package contains C software to implement JPEG image compression and
78 decompression. JPEG (pronounced "jay-peg") is a standardized compression
79 method for full-color and gray-scale images. JPEG is intended for compressing
80 "real-world" scenes; line drawings, cartoons and other non-realistic images
81 are not its strong suit. JPEG is lossy, meaning that the output image is not
82 exactly identical to the input image. Hence you must not use JPEG if you
83 have to have identical output bits. However, on typical photographic images,
84 very good compression levels can be obtained with no visible change, and
85 remarkably high compression levels are possible if you can tolerate a
86 low-quality image. For more details, see the references, or just experiment
87 with various compression settings.
88
89 This software implements JPEG baseline, extended-sequential, and progressive
90 compression processes. Provision is made for supporting all variants of these
91 processes, although some uncommon parameter settings aren't implemented yet.
92 For legal reasons, we are not distributing code for the arithmetic-coding
93 variants of JPEG; see LEGAL ISSUES. We have made no provision for supporting
94 the hierarchical or lossless processes defined in the standard.
95
96 We provide a set of library routines for reading and writing JPEG image files,
97 plus two sample applications "cjpeg" and "djpeg", which use the library to
98 perform conversion between JPEG and some other popular image file formats.
99 The library is intended to be reused in other applications.
100
101 In order to support file conversion and viewing software, we have included
102 considerable functionality beyond the bare JPEG coding/decoding capability;
103 for example, the color quantization modules are not strictly part of JPEG
104 decoding, but they are essential for output to colormapped file formats or
105 colormapped displays. These extra functions can be compiled out of the
106 library if not required for a particular application. We have also included
107 "jpegtran", a utility for lossless transcoding between different JPEG
108 processes, and "rdjpgcom" and "wrjpgcom", two simple applications for
109 inserting and extracting textual comments in JFIF files.
110
111 The emphasis in designing this software has been on achieving portability and
112 flexibility, while also making it fast enough to be useful. In particular,
113 the software is not intended to be read as a tutorial on JPEG. (See the
114 REFERENCES section for introductory material.) Rather, it is intended to
115 be reliable, portable, industrial-strength code. We do not claim to have
116 achieved that goal in every aspect of the software, but we strive for it.
117
118 We welcome the use of this software as a component of commercial products.
119 No royalty is required, but we do ask for an acknowledgement in product
120 documentation, as described under LEGAL ISSUES.
121
122
123 LEGAL ISSUES
124 ============
125
126 In plain English:
127
128 1. We don't promise that this software works. (But if you find any bugs,
129 please let us know!)
130 2. You can use this software for whatever you want. You don't have to pay us.
131 3. You may not pretend that you wrote this software. If you use it in a
132 program, you must acknowledge somewhere in your documentation that
133 you've used the IJG code.
134
135 In legalese:
136
137 The authors make NO WARRANTY or representation, either express or implied,
138 with respect to this software, its quality, accuracy, merchantability, or
139 fitness for a particular purpose. This software is provided "AS IS", and you,
140 its user, assume the entire risk as to its quality and accuracy.
141
142 This software is copyright (C) 1991-1998, Thomas G. Lane.
143 All Rights Reserved except as specified below.
144
145 Permission is hereby granted to use, copy, modify, and distribute this
146 software (or portions thereof) for any purpose, without fee, subject to these
147 conditions:
148 (1) If any part of the source code for this software is distributed, then this
149 README file must be included, with this copyright and no-warranty notice
150 unaltered; and any additions, deletions, or changes to the original files
151 must be clearly indicated in accompanying documentation.
152 (2) If only executable code is distributed, then the accompanying
153 documentation must state that "this software is based in part on the work of
154 the Independent JPEG Group".
155 (3) Permission for use of this software is granted only if the user accepts
156 full responsibility for any undesirable consequences; the authors accept
157 NO LIABILITY for damages of any kind.
158
159 These conditions apply to any software derived from or based on the IJG code,
160 not just to the unmodified library. If you use our work, you ought to
161 acknowledge us.
162
163 Permission is NOT granted for the use of any IJG author's name or company name
164 in advertising or publicity relating to this software or products derived from
165 it. This software may be referred to only as "the Independent JPEG Group's
166 software".
167
168 We specifically permit and encourage the use of this software as the basis of
169 commercial products, provided that all warranty or liability claims are
170 assumed by the product vendor.
171
172
173 ansi2knr.c is included in this distribution by permission of L. Peter Deutsch,
174 sole proprietor of its copyright holder, Aladdin Enterprises of Menlo Park, CA.
175 ansi2knr.c is NOT covered by the above copyright and conditions, but instead
176 by the usual distribution terms of the Free Software Foundation; principally,
177 that you must include source code if you redistribute it. (See the file
178 ansi2knr.c for full details.) However, since ansi2knr.c is not needed as part
179 of any program generated from the IJG code, this does not limit you more than
180 the foregoing paragraphs do.
181
182 The Unix configuration script "configure" was produced with GNU Autoconf.
183 It is copyright by the Free Software Foundation but is freely distributable.
184 The same holds for its supporting scripts (config.guess, config.sub,
185 ltconfig, ltmain.sh). Another support script, install-sh, is copyright
186 by M.I.T. but is also freely distributable.
187
188 It appears that the arithmetic coding option of the JPEG spec is covered by
189 patents owned by IBM, AT&T, and Mitsubishi. Hence arithmetic coding cannot
190 legally be used without obtaining one or more licenses. For this reason,
191 support for arithmetic coding has been removed from the free JPEG software.
192 (Since arithmetic coding provides only a marginal gain over the unpatented
193 Huffman mode, it is unlikely that very many implementations will support it.)
194 So far as we are aware, there are no patent restrictions on the remaining
195 code.
196
197 The IJG distribution formerly included code to read and write GIF files.
198 To avoid entanglement with the Unisys LZW patent, GIF reading support has
199 been removed altogether, and the GIF writer has been simplified to produce
200 "uncompressed GIFs". This technique does not use the LZW algorithm; the
201 resulting GIF files are larger than usual, but are readable by all standard
202 GIF decoders.
203
204 We are required to state that
205 "The Graphics Interchange Format(c) is the Copyright property of
206 CompuServe Incorporated. GIF(sm) is a Service Mark property of
207 CompuServe Incorporated."
208
209
210 REFERENCES
211 ==========
212
213 We highly recommend reading one or more of these references before trying to
214 understand the innards of the JPEG software.
215
216 The best short technical introduction to the JPEG compression algorithm is
217 Wallace, Gregory K. "The JPEG Still Picture Compression Standard",
218 Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44.
219 (Adjacent articles in that issue discuss MPEG motion picture compression,
220 applications of JPEG, and related topics.) If you don't have the CACM issue
221 handy, a PostScript file containing a revised version of Wallace's article is
222 available at ftp://ftp.uu.net/graphics/jpeg/wallace.ps.gz. The file (actually
223 a preprint for an article that appeared in IEEE Trans. Consumer Electronics)
224 omits the sample images that appeared in CACM, but it includes corrections
225 and some added material. Note: the Wallace article is copyright ACM and IEEE,
226 and it may not be used for commercial purposes.
227
228 A somewhat less technical, more leisurely introduction to JPEG can be found in
229 "The Data Compression Book" by Mark Nelson and Jean-loup Gailly, published by
230 M&T Books (New York), 2nd ed. 1996, ISBN 1-55851-434-1. This book provides
231 good explanations and example C code for a multitude of compression methods
232 including JPEG. It is an excellent source if you are comfortable reading C
233 code but don't know much about data compression in general. The book's JPEG
234 sample code is far from industrial-strength, but when you are ready to look
235 at a full implementation, you've got one here...
236
237 The best full description of JPEG is the textbook "JPEG Still Image Data
238 Compression Standard" by William B. Pennebaker and Joan L. Mitchell, published
239 by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1. Price US$59.95, 638 pp.
240 The book includes the complete text of the ISO JPEG standards (DIS 10918-1
241 and draft DIS 10918-2). This is by far the most complete exposition of JPEG
242 in existence, and we highly recommend it.
243
244 The JPEG standard itself is not available electronically; you must order a
245 paper copy through ISO or ITU. (Unless you feel a need to own a certified
246 official copy, we recommend buying the Pennebaker and Mitchell book instead;
247 it's much cheaper and includes a great deal of useful explanatory material.)
248 In the USA, copies of the standard may be ordered from ANSI Sales at (212)
249 642-4900, or from Global Engineering Documents at (800) 854-7179. (ANSI
250 doesn't take credit card orders, but Global does.) It's not cheap: as of
251 1992, ANSI was charging $95 for Part 1 and $47 for Part 2, plus 7%
252 shipping/handling. The standard is divided into two parts, Part 1 being the
253 actual specification, while Part 2 covers compliance testing methods. Part 1
254 is titled "Digital Compression and Coding of Continuous-tone Still Images,
255 Part 1: Requirements and guidelines" and has document numbers ISO/IEC IS
256 10918-1, ITU-T T.81. Part 2 is titled "Digital Compression and Coding of
257 Continuous-tone Still Images, Part 2: Compliance testing" and has document
258 numbers ISO/IEC IS 10918-2, ITU-T T.83.
259
260 Some extensions to the original JPEG standard are defined in JPEG Part 3,
261 a newer ISO standard numbered ISO/IEC IS 10918-3 and ITU-T T.84. IJG
262 currently does not support any Part 3 extensions.
263
264 The JPEG standard does not specify all details of an interchangeable file
265 format. For the omitted details we follow the "JFIF" conventions, revision
266 1.02. A copy of the JFIF spec is available from:
267 Literature Department
268 C-Cube Microsystems, Inc.
269 1778 McCarthy Blvd.
270 Milpitas, CA 95035
271 phone (408) 944-6300, fax (408) 944-6314
272 A PostScript version of this document is available by FTP at
273 ftp://ftp.uu.net/graphics/jpeg/jfif.ps.gz. There is also a plain text
274 version at ftp://ftp.uu.net/graphics/jpeg/jfif.txt.gz, but it is missing
275 the figures.
276
277 The TIFF 6.0 file format specification can be obtained by FTP from
278 ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation scheme
279 found in the TIFF 6.0 spec of 3-June-92 has a number of serious problems.
280 IJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6).
281 Instead, we recommend the JPEG design proposed by TIFF Technical Note #2
282 (Compression tag 7). Copies of this Note can be obtained from ftp.sgi.com or
283 from ftp://ftp.uu.net/graphics/jpeg/. It is expected that the next revision
284 of the TIFF spec will replace the 6.0 JPEG design with the Note's design.
285 Although IJG's own code does not support TIFF/JPEG, the free libtiff library
286 uses our library to implement TIFF/JPEG per the Note. libtiff is available
287 from ftp://ftp.sgi.com/graphics/tiff/.
288
289
290 ARCHIVE LOCATIONS
291 =================
292
293 The "official" archive site for this software is ftp.uu.net (Internet
294 address 192.48.96.9). The most recent released version can always be found
295 there in directory graphics/jpeg. This particular version will be archived
296 as ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz. If you don't have
297 direct Internet access, UUNET's archives are also available via UUCP; contact
298 [email protected] for information on retrieving files that way.
299
300 Numerous Internet sites maintain copies of the UUNET files. However, only
301 ftp.uu.net is guaranteed to have the latest official version.
302
303 You can also obtain this software in DOS-compatible "zip" archive format from
304 the SimTel archives (ftp://ftp.simtel.net/pub/simtelnet/msdos/graphics/), or
305 on CompuServe in the Graphics Support forum (GO CIS:GRAPHSUP), library 12
306 "JPEG Tools". Again, these versions may sometimes lag behind the ftp.uu.net
307 release.
308
309 The JPEG FAQ (Frequently Asked Questions) article is a useful source of
310 general information about JPEG. It is updated constantly and therefore is
311 not included in this distribution. The FAQ is posted every two weeks to
312 Usenet newsgroups comp.graphics.misc, news.answers, and other groups.
313 It is available on the World Wide Web at http://www.faqs.org/faqs/jpeg-faq/
314 and other news.answers archive sites, including the official news.answers
315 archive at rtfm.mit.edu: ftp://rtfm.mit.edu/pub/usenet/news.answers/jpeg-faq/.
316 If you don't have Web or FTP access, send e-mail to [email protected]
317 with body
318 send usenet/news.answers/jpeg-faq/part1
319 send usenet/news.answers/jpeg-faq/part2
320
321
322 RELATED SOFTWARE
323 ================
324
325 Numerous viewing and image manipulation programs now support JPEG. (Quite a
326 few of them use this library to do so.) The JPEG FAQ described above lists
327 some of the more popular free and shareware viewers, and tells where to
328 obtain them on Internet.
329
330 If you are on a Unix machine, we highly recommend Jef Poskanzer's free
331 PBMPLUS software, which provides many useful operations on PPM-format image
332 files. In particular, it can convert PPM images to and from a wide range of
333 other formats, thus making cjpeg/djpeg considerably more useful. The latest
334 version is distributed by the NetPBM group, and is available from numerous
335 sites, notably ftp://wuarchive.wustl.edu/graphics/graphics/packages/NetPBM/.
336 Unfortunately PBMPLUS/NETPBM is not nearly as portable as the IJG software is;
337 you are likely to have difficulty making it work on any non-Unix machine.
338
339 A different free JPEG implementation, written by the PVRG group at Stanford,
340 is available from ftp://havefun.stanford.edu/pub/jpeg/. This program
341 is designed for research and experimentation rather than production use;
342 it is slower, harder to use, and less portable than the IJG code, but it
343 is easier to read and modify. Also, the PVRG code supports lossless JPEG,
344 which we do not. (On the other hand, it doesn't do progressive JPEG.)
345
346
347 FILE FORMAT WARS
348 ================
349
350 Some JPEG programs produce files that are not compatible with our library.
351 The root of the problem is that the ISO JPEG committee failed to specify a
352 concrete file format. Some vendors "filled in the blanks" on their own,
353 creating proprietary formats that no one else could read. (For example, none
354 of the early commercial JPEG implementations for the Macintosh were able to
355 exchange compressed files.)
356
357 The file format we have adopted is called JFIF (see REFERENCES). This format
358 has been agreed to by a number of major commercial JPEG vendors, and it has
359 become the de facto standard. JFIF is a minimal or "low end" representation.
360 We recommend the use of TIFF/JPEG (TIFF revision 6.0 as modified by TIFF
361 Technical Note #2) for "high end" applications that need to record a lot of
362 additional data about an image. TIFF/JPEG is fairly new and not yet widely
363 supported, unfortunately.
364
365 The upcoming JPEG Part 3 standard defines a file format called SPIFF.
366 SPIFF is interoperable with JFIF, in the sense that most JFIF decoders should
367 be able to read the most common variant of SPIFF. SPIFF has some technical
368 advantages over JFIF, but its major claim to fame is simply that it is an
369 official standard rather than an informal one. At this point it is unclear
370 whether SPIFF will supersede JFIF or whether JFIF will remain the de-facto
371 standard. IJG intends to support SPIFF once the standard is frozen, but we
372 have not decided whether it should become our default output format or not.
373 (In any case, our decoder will remain capable of reading JFIF indefinitely.)
374
375 Various proprietary file formats incorporating JPEG compression also exist.
376 We have little or no sympathy for the existence of these formats. Indeed,
377 one of the original reasons for developing this free software was to help
378 force convergence on common, open format standards for JPEG files. Don't
379 use a proprietary file format!
380
381
382 TO DO
383 =====
384
385 The major thrust for v7 will probably be improvement of visual quality.
386 The current method for scaling the quantization tables is known not to be
387 very good at low Q values. We also intend to investigate block boundary
388 smoothing, "poor man's variable quantization", and other means of improving
389 quality-vs-file-size performance without sacrificing compatibility.
390
391 In future versions, we are considering supporting some of the upcoming JPEG
392 Part 3 extensions --- principally, variable quantization and the SPIFF file
393 format.
394
395 As always, speeding things up is of great interest.
396
397 Please send bug reports, offers of help, etc. to [email protected].