home *** CD-ROM | disk | FTP | other *** search
/ Photo CD Demo 1 / Demo.bin / compresn / jpegv3sr / readme < prev    next >
Text File  |  1992-03-17  |  19KB  |  361 lines

  1. The Independent JPEG Group's JPEG software
  2. ==========================================
  3.  
  4. README for release 3 of  17-Mar-92
  5. ==================================
  6.  
  7. This distribution contains the third official release of the Independent JPEG
  8. Group's free JPEG software.  You are welcome to redistribute this software and
  9. to use it for any purpose, subject to the conditions under LEGAL ISSUES, below.
  10.  
  11. For installation instructions, see file SETUP; for usage instructions, see
  12. file USAGE (or the cjpeg.1 and djpeg.1 manual pages).
  13.  
  14. This software is still undergoing revision.  Updated versions may be obtained
  15. by FTP or UUCP to UUNET and other archive sites; see ARCHIVE LOCATIONS below
  16. for details.
  17.  
  18. If you intend to become a serious user of this software, please contact
  19. jpeg-info@uunet.uu.net to be added to our electronic mailing list.  Then
  20. you'll be notified of updates and have a chance to participate in discussions,
  21. etc.
  22.  
  23. This software is the work of Tom Lane, Philip Gladstone, Luis Ortiz,
  24. Lee Crocker, Ge' Weijers, and other members of the Independent JPEG Group.
  25.  
  26.  
  27. DISCLAIMER
  28. ==========
  29.  
  30. THIS SOFTWARE IS NOT COMPLETE NOR FULLY DEBUGGED.  It is not guaranteed to be
  31. useful for anything, nor to be compatible with subsequent releases, nor to be
  32. an accurate implementation of the JPEG standard.  (See LEGAL ISSUES for even
  33. more disclaimers.)
  34.  
  35. Please report any problems with this software to jpeg-info@uunet.uu.net.
  36.  
  37.  
  38. WHAT'S HERE
  39. ===========
  40.  
  41. This distribution contains C software to implement JPEG image compression and
  42. decompression.  JPEG (pronounced "jay-peg") is a standardized compression
  43. method for full-color and gray-scale images.  JPEG is intended for
  44. "real-world" scenes; cartoons and other non-realistic images are not its
  45. strong suit.  JPEG is lossy, meaning that the output image is not necessarily
  46. identical to the input image.  Hence you should not use JPEG if you have to
  47. have identical output bits.  However, on typical images of real-world scenes,
  48. very good compression levels can be obtained with no visible change, and
  49. amazingly high compression levels can be obtained if you can tolerate a
  50. low-quality image.  For more details, see the references, or just experiment
  51. with various compression settings.
  52.  
  53. The software implements JPEG baseline and extended-sequential compression
  54. processes.  Provision is made for supporting all variants of these processes,
  55. although some uncommon parameter settings aren't implemented yet.  For legal
  56. reasons, we are not distributing code for the arithmetic-coding process; see
  57. LEGAL ISSUES.  At present we have made no provision for supporting the
  58. progressive, hierarchical, or lossless processes defined in the standard.
  59.  
  60. The present software is not far beyond the prototype stage.  It does not
  61. support all possible variants of the JPEG standard, and some functions have
  62. rather slow and/or crude implementations.  However, it is useful already.
  63.  
  64. The emphasis in designing this software has been on achieving portability and
  65. flexibility, while also making it fast enough to be useful.  We have not yet
  66. undertaken serious performance measurement or tuning; we intend to do so in
  67. the future.
  68.  
  69.  
  70. This software can be used on several levels:
  71.  
  72. * As canned software for JPEG compression and decompression.  Just edit the
  73.   Makefile and configuration files as needed (see file SETUP), compile and go.
  74.   Members of the Independent JPEG Group will improve the out-of-the-box
  75.   functionality and speed as time goes on.
  76.  
  77. * As the basis for other JPEG programs.  For example, you could incorporate
  78.   the decompressor into a general image viewing package by replacing the
  79.   output module with write-to-screen functions.  For an implementation on
  80.   specific hardware, you might want to replace some of the inner loops with
  81.   assembly code.  For a non-command-line-driven system, you might want a
  82.   different user interface.  (Members of the group will be producing Macintosh
  83.   and Amiga versions with more appropriate user interfaces, for example.)
  84.  
  85. * As a toolkit for experimentation with JPEG and JPEG-like algorithms.  Most
  86.   of the individual decisions you might want to mess with are packaged up into
  87.   separate modules.  For example, the details of color-space conversion and
  88.   subsampling techniques are each localized in one compressor and one
  89.   decompressor module.  You'd probably also want to extend the user interface
  90.   to give you more detailed control over the JPEG compression parameters.
  91.  
  92. In particular, we welcome the use of this software as a component of commercial
  93. products; no royalty is required.
  94.  
  95.  
  96. ARCHIVE LOCATIONS
  97. =================
  98.  
  99. The "official" archive site for this software is ftp.uu.net (Internet
  100. address 137.39.1.9 or 192.48.96.9).  The most recent released version can
  101. always be found there in directory graphics/jpeg.  This particular version
  102. will be archived as jpegsrc.v3.tar.Z.  If you are on the Internet, you can
  103. retrieve files from UUNET by anonymous FTP.  If you don't have FTP access,
  104. UUNET's archives are also available via UUCP; contact postmaster@uunet.uu.net
  105. for information on retrieving files that way.
  106.  
  107. Various other Internet sites maintain copies of the UUNET file, which may or
  108. may not be up-to-date.  In Europe, try nic.funet.fi (128.214.6.100; look in
  109. directory pub/graphics/programs/jpeg).
  110.  
  111. You can also obtain this software from CompuServe, in the GRAPHSUPPORT forum
  112. (GO PICS), library 10; this version will be file jpsrc3.zip.
  113.  
  114. If you are not reasonably handy at configuring and installing portable C
  115. programs, you may have some difficulty installing this package.  You may
  116. prefer to obtain a pre-built executable version.  A collection of pre-built
  117. executables for various machines is currently available for anonymous FTP at
  118. procyon.cis.ksu.edu (129.130.10.80 --- this number is due to change soon);
  119. look under /pub/JPEG.  The administrators of this system ask that FTP traffic
  120. be limited to non-prime hours.  For more information on this archive, please
  121. contact Steve Davis (strat@cis.ksu.edu).  This collection is not maintained by
  122. the Independent JPEG Group, and programs in it may not be the latest version.
  123.  
  124.  
  125. SUPPORTING SOFTWARE
  126. ===================
  127.  
  128. You will probably want Jef Poskanzer's PBMPLUS image software, which provides
  129. many useful operations on PPM-format image files.  In particular, it can
  130. convert PPM images to and from a wide range of other formats.  You can FTP
  131. this free software from export.lcs.mit.edu (contrib/pbmplus*.tar.Z) or
  132. ftp.ee.lbl.gov (pbmplus*.tar.Z).  Unfortunately PBMPLUS is not nearly as
  133. portable as the JPEG software is; you are likely to have difficulty making it
  134. work on any non-Unix machine.
  135.  
  136. If you are using X Windows you might want to use the xv or xloadimage viewers
  137. to save yourself the trouble of converting PPM to some other format.  Both of
  138. these can be found in the contrib directory at export.lcs.mit.edu.  Actually,
  139. xv version 2.00 and up incorporates our software and thus can read and write
  140. JPEG files directly.  (NOTE: since xv internally reduces all images to 8
  141. bits/pixel, a JPEG file written by xv will not be very high quality; you may
  142. also prefer xloadimage for viewing if you have a 24-bit display.  Caveat user.)
  143.  
  144. For DOS machines, Lee Crocker's free Piclab program is a useful companion to
  145. the JPEG software.  The latest version, currently 1.91, is available by FTP
  146. from SIMTEL20 and its various mirror sites, file <msdos.graphics>piclb191.zip.
  147. CompuServe also has it, in the same library as the JPEG software.
  148.  
  149.  
  150. SOFTWARE THAT'S NO HELP AT ALL
  151. ==============================
  152.  
  153. Handmade Software's shareware PC program GIF2JPG produces files that are
  154. totally incompatible with our programs.  They use a proprietary format that is
  155. an amalgam of GIF and JPEG representations.  However, you can force GIF2JPG
  156. to produce compatible files with its -j switch, and their decompression
  157. program JPG2GIF can read our files (at least ones produced with our default
  158. option settings).
  159.  
  160. Unfortunately, many commercial JPEG implementations are also incompatible as
  161. of this writing, especially programs released before summer 1991.  The root of
  162. the problem is that the ISO JPEG committee failed to specify a concrete file
  163. format.  Some vendors "filled in the blanks" on their own, creating
  164. proprietary formats that no one else could read.  (For example, none of the
  165. early commercial JPEG implementations for the Macintosh were able to exchange
  166. compressed files.)
  167.  
  168. The file format we have adopted is called JFIF (see REFERENCES).  This format
  169. has been agreed to by a number of major commercial JPEG vendors, and we expect
  170. that it will become the de facto standard.  JFIF is a minimal representation;
  171. work is also going forward to incorporate JPEG compression into the TIFF
  172. standard, for use in "high end" applications that need to record a lot of
  173. additional data about an image.  We intend to support JPEG-in-TIFF in the
  174. future.  We hope that these two formats will be sufficient and that other,
  175. incompatible JPEG file formats will not proliferate.
  176.  
  177. Indeed, part of the reason for developing and releasing this free software is
  178. to help force rapid convergence to de facto standards for JPEG file formats.
  179. SUPPORT STANDARD, NON-PROPRIETARY FORMATS: demand JFIF or JPEG-in-TIFF!
  180.  
  181.  
  182. USING JPEG AS A SUBROUTINE IN A LARGER PROGRAM
  183. ==============================================
  184.  
  185. You can readily incorporate the JPEG compression and decompression routines in
  186. a larger program.  The file example.c provides a skeleton of the interface
  187. routines you'll need for this purpose.  Essentially, you replace jcmain.c (for
  188. compression) and/or jdmain.c (for decompression) with your own code.  Note
  189. that the fewer JPEG options you allow the user to twiddle, the less code you
  190. need; all the default options are set up automatically.  (Alternately, if you
  191. know a lot about JPEG or have a special application, you may want to twiddle
  192. the default options even more extensively than jcmain/jdmain do.)
  193.  
  194. Most likely, you will want the uncompressed image to come from memory (for
  195. compression) or go to memory or the screen (for decompression).  For this
  196. purpose you must provide image reading or writing routines that match the
  197. interface used by the image file I/O modules (jrdXXX or jwrXXX); again,
  198. example.c shows a skeleton of what is required.
  199.  
  200. By default, any error detected inside the JPEG routines will cause a message
  201. to be printed on stderr, followed by exit().  You can override this behavior
  202. by supplying your own message-printing and/or error-exit routines; again,
  203. example.c shows how.
  204.  
  205. Mechanics: we recommend you create libjpeg.a as shown in the Makefile, then
  206. link that with your surrounding program.  (If your linker is at all
  207. reasonable, only the code you actually need will get loaded.)  Include the
  208. files jconfig.h and jpegdata.h in C files that need to call the JPEG routines.
  209.  
  210. CAUTION: some people have tried to compile JPEG and their surrounding code
  211. with different compilers, e.g., cc for JPEG and c++ or gcc for the rest.  This
  212. is a Real Bad Move and you will deserve what happens to you if you try it.
  213. (Hint: the parameter structures can get laid out differently with no warning.)
  214.  
  215. Read our "architecture" file for more info.  If it seems to you that the
  216. software structure doesn't accommodate what you want to do, please contact
  217. the authors.
  218.  
  219. Beginning with version 3, we will endeavor to hold the interface described by
  220. example.c constant, so that you can plug in updated versions of the JPEG code
  221. just by recompiling.  However, we can't guarantee this, especially if you
  222. choose to twiddle any JPEG options not listed in example.c.  Check the
  223. CHANGELOG when installing any new version, and compare example.c against the
  224. prior version.  Recompile your calling software (don't just relink), as we may
  225. add or subtract fields in the parameter structures.
  226.  
  227.  
  228. REFERENCES
  229. ==========
  230.  
  231. The best and most readily available introduction to the JPEG compression
  232. algorithm is Wallace's article in the April '91 CACM:
  233.     Wallace, Gregory K.  "The JPEG Still Picture Compression Standard",
  234.     Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44.
  235. (Adjacent articles in that issue discuss MPEG motion picture compression,
  236. applications of JPEG, and related topics.)  We highly recommend reading that
  237. article before trying to understand the innards of any JPEG software.
  238. If you don't have the CACM issue handy, a PostScript file containing a revised
  239. version of the article is available at ftp.uu.net, graphics/jpeg/wallace.ps.Z.
  240. The file (actually a preprint for an article to appear in IEEE Trans. Consumer
  241. Electronics) omits the sample images that appeared in CACM, but it includes
  242. corrections and some added material.  Note: the Wallace article is copyright
  243. ACM and IEEE, and it may not be used for commercial purposes.
  244.  
  245. For more detail about the JPEG standard you pretty much have to go to the
  246. draft standard (which is not nearly as intelligible as Wallace's article).
  247. The standard is not now available electronically; you must order a paper copy
  248. through ISO.  In the US, copies may be ordered from ANSI Sales at (212)
  249. 642-4900.  The standard is divided into two parts: Part 1 is the actual
  250. specification, and Part 2 covers compliance testing methods.  The current
  251. "committee draft" version of Part 1 is titled "Digital Compression and Coding
  252. of Continuous-tone Still Images, Part 1: Requirements and guidelines" and has
  253. document number ISO/IEC CD 10918-1.  (The alternate number SC2 N2215 should
  254. also be mentioned when ordering.)  This draft is expected to be superseded by
  255. the Draft International Standard version around the end of November 1991.
  256. Ordering info will be the same as above, but replace "CD" with "DIS" in the
  257. document number (alternate number not yet known).  The committee draft of
  258. Part 2 is expected to be available around the end of December 1991.  It will
  259. be titled "Digital Compression and Coding of Continuous-tone Still Images,
  260. Part 2: Compliance testing" and will have document number ISO/IEC CD 10918-2
  261. (alternate number not yet known).
  262.  
  263. The JPEG standard does not specify all details of an interchangeable file
  264. format.  For the omitted details we follow the "JFIF" conventions, revision
  265. 1.01.  A copy of the JFIF spec is available from:
  266.     Literature Department
  267.     C-Cube Microsystems, Inc.
  268.     399A West Trimble Road
  269.     San Jose, CA  95131
  270.     (408) 944-6300
  271. The same source can supply copies of the draft JPEG-in-TIFF documents
  272. (Appendixes O and P to the TIFF spec).  PostScript versions of these
  273. documents can also be obtained by e-mail from the C-Cube mail server,
  274. netlib@c3.pla.ca.us.  Send the message "send jfif_ps from jpeg" to obtain the
  275. JFIF document; "send app_o_ps from jpeg" and "send app_p_ps from jpeg" will
  276. produce the TIFF documents.  Send the message "help" if you have trouble.
  277.  
  278. If you want to understand this implementation, start by reading the
  279. "architecture" documentation file.  Please read "codingrules" if you want to
  280. contribute any code.
  281.  
  282.  
  283. LEGAL ISSUES
  284. ============
  285.  
  286. The authors make NO WARRANTY or representation, either express or implied,
  287. with respect to this software, its quality, accuracy, merchantability, or
  288. fitness for a particular purpose.  This software is provided "AS IS", and you,
  289. its user, assume the entire risk as to its quality and accuracy.
  290.  
  291. This software is copyright (C) 1991, 1992, Thomas G. Lane.
  292. All Rights Reserved except as specified below.
  293.  
  294. Permission is hereby granted to use, copy, modify, and distribute this
  295. software (or portions thereof) for any purpose, without fee, subject to these
  296. conditions:
  297. (1) If any part of the source code for this software is distributed, then this
  298. README file must be included, with this copyright and no-warranty notice
  299. unaltered; and any additions, deletions, or changes to the original files
  300. must be clearly indicated in accompanying documentation.
  301. (2) If only executable code is distributed, then the accompanying
  302. documentation must state that "this software is based in part on the work of
  303. the Independent JPEG Group".
  304. (3) Permission for use of this software is granted only if the user accepts
  305. full responsibility for any undesirable consequences; the authors accept
  306. NO LIABILITY for damages of any kind.
  307.  
  308. Permission is NOT granted for the use of any author's name or author's company
  309. name in advertising or publicity relating to this software or products derived
  310. from it.  This software may be referred to only as "the Independent JPEG
  311. Group's software".
  312.  
  313. We specifically permit and encourage the use of this software as the basis of
  314. commercial products, provided that all warranty or liability claims are
  315. assumed by the product vendor.
  316.  
  317.  
  318. ansi2knr.c is included in this distribution by permission of L. Peter Deutsch,
  319. sole proprietor of its copyright holder, Aladdin Enterprises of Menlo Park, CA.
  320. ansi2knr.c is NOT covered by the above copyright and conditions, but instead
  321. by the usual distribution terms of the Free Software Foundation; principally,
  322. that you must include source code if you redistribute it.  (See the file
  323. ansi2knr.c for full details.)  However, since ansi2knr.c is not needed as part
  324. of any product generated from the JPEG code, this does not limit you more than
  325. the foregoing paragraphs do.
  326.  
  327.  
  328. It appears that the arithmetic coding option of the JPEG spec is covered by
  329. patents owned by IBM and AT&T, as well as a pending Japanese patent of
  330. Mitsubishi.  Hence arithmetic coding cannot legally be used without obtaining
  331. one or more licenses.  For this reason, support for arithmetic coding has been
  332. removed from the free JPEG software.  (Since arithmetic coding provides only a
  333. marginal gain over the unpatented Huffman mode, it is unlikely that very many
  334. people will choose to use it.  If you do obtain the necessary licenses,
  335. contact jpeg-info@uunet.uu.net for a copy of our arithmetic coding modules.)
  336. So far as we are aware, there are no patent restrictions on the remaining
  337. code.
  338.  
  339.  
  340. We are required to state that
  341.     "The Graphics Interchange Format(c) is the Copyright property of
  342.     CompuServe Incorporated.  GIF(sm) is a Service Mark property of
  343.     CompuServe Incorporated."
  344.  
  345.  
  346. TO DO
  347. =====
  348.  
  349. Many of the modules need fleshing out to provide more complete
  350. implementations, or to provide faster paths for common cases.
  351. Improving the speed will be the next big work item for the JPEG group.
  352.  
  353. We'd appreciate it if people would compile and check out the code on as wide a
  354. variety of systems as possible, and report any portability problems
  355. encountered (with solutions, if possible).  Checks of file compatibility with
  356. other JPEG implementations would also be of interest.  Finally, we would
  357. appreciate code profiles showing where the most time is spent, especially on
  358. unusual systems.
  359.  
  360. Please send bug reports, offers of help, etc. to jpeg-info@uunet.uu.net.
  361.