shun-iwasawa 82a8f5
libjpeg-turbo note:  This file has been modified by The libjpeg-turbo Project
shun-iwasawa 82a8f5
to include only information relevant to libjpeg-turbo, to wordsmith certain
shun-iwasawa 82a8f5
sections, and to remove impolitic language that existed in the libjpeg v8
shun-iwasawa 82a8f5
README.  It is included only for reference.  Please see README.md for
shun-iwasawa 82a8f5
information specific to libjpeg-turbo.
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
kusano 7d535a
The Independent JPEG Group's JPEG software
kusano 7d535a
==========================================
kusano 7d535a
shun-iwasawa 82a8f5
This distribution contains a release of the Independent JPEG Group's free JPEG
shun-iwasawa 82a8f5
software.  You are welcome to redistribute this software and to use it for any
shun-iwasawa 82a8f5
purpose, subject to the conditions under LEGAL ISSUES, below.
kusano 7d535a
kusano 7d535a
This software is the work of Tom Lane, Guido Vollbeding, Philip Gladstone,
kusano 7d535a
Bill Allombert, Jim Boucher, Lee Crocker, Bob Friesenhahn, Ben Jackson,
kusano 7d535a
Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi, Ge' Weijers,
kusano 7d535a
and other members of the Independent JPEG Group.
kusano 7d535a
kusano 7d535a
IJG is not affiliated with the ISO/IEC JTC1/SC29/WG1 standards committee
kusano 7d535a
(also known as JPEG, together with ITU-T SG16).
kusano 7d535a
kusano 7d535a
kusano 7d535a
DOCUMENTATION ROADMAP
kusano 7d535a
=====================
kusano 7d535a
kusano 7d535a
This file contains the following sections:
kusano 7d535a
kusano 7d535a
OVERVIEW            General description of JPEG and the IJG software.
kusano 7d535a
LEGAL ISSUES        Copyright, lack of warranty, terms of distribution.
kusano 7d535a
REFERENCES          Where to learn more about JPEG.
kusano 7d535a
ARCHIVE LOCATIONS   Where to find newer versions of this software.
kusano 7d535a
FILE FORMAT WARS    Software *not* to get.
kusano 7d535a
TO DO               Plans for future IJG releases.
kusano 7d535a
kusano 7d535a
Other documentation files in the distribution are:
kusano 7d535a
kusano 7d535a
User documentation:
kusano 7d535a
  usage.txt         Usage instructions for cjpeg, djpeg, jpegtran,
kusano 7d535a
                    rdjpgcom, and wrjpgcom.
kusano 7d535a
  *.1               Unix-style man pages for programs (same info as usage.txt).
kusano 7d535a
  wizard.txt        Advanced usage instructions for JPEG wizards only.
kusano 7d535a
  change.log        Version-to-version change highlights.
kusano 7d535a
Programmer and internal documentation:
kusano 7d535a
  libjpeg.txt       How to use the JPEG library in your own programs.
shun-iwasawa 82a8f5
  example.txt       Sample code for calling the JPEG library.
kusano 7d535a
  structure.txt     Overview of the JPEG library's internal structure.
kusano 7d535a
  coderules.txt     Coding style rules --- please read if you contribute code.
kusano 7d535a
shun-iwasawa 82a8f5
Please read at least usage.txt.  Some information can also be found in the JPEG
shun-iwasawa 82a8f5
FAQ (Frequently Asked Questions) article.  See ARCHIVE LOCATIONS below to find
shun-iwasawa 82a8f5
out where to obtain the FAQ article.
kusano 7d535a
kusano 7d535a
If you want to understand how the JPEG code works, we suggest reading one or
kusano 7d535a
more of the REFERENCES, then looking at the documentation files (in roughly
kusano 7d535a
the order listed) before diving into the code.
kusano 7d535a
kusano 7d535a
kusano 7d535a
OVERVIEW
kusano 7d535a
========
kusano 7d535a
kusano 7d535a
This package contains C software to implement JPEG image encoding, decoding,
kusano 7d535a
and transcoding.  JPEG (pronounced "jay-peg") is a standardized compression
shun-iwasawa 82a8f5
method for full-color and grayscale images.  JPEG's strong suit is compressing
shun-iwasawa 82a8f5
photographic images or other types of images that have smooth color and
shun-iwasawa 82a8f5
brightness transitions between neighboring pixels.  Images with sharp lines or
shun-iwasawa 82a8f5
other abrupt features may not compress well with JPEG, and a higher JPEG
shun-iwasawa 82a8f5
quality may have to be used to avoid visible compression artifacts with such
shun-iwasawa 82a8f5
images.
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
JPEG is lossy, meaning that the output pixels are not necessarily identical to
shun-iwasawa 82a8f5
the input pixels.  However, on photographic content and other "smooth" images,
shun-iwasawa 82a8f5
very good compression ratios can be obtained with no visible compression
shun-iwasawa 82a8f5
artifacts, and extremely high compression ratios are possible if you are
shun-iwasawa 82a8f5
willing to sacrifice image quality (by reducing the "quality" setting in the
shun-iwasawa 82a8f5
compressor.)
kusano 7d535a
kusano 7d535a
This software implements JPEG baseline, extended-sequential, and progressive
kusano 7d535a
compression processes.  Provision is made for supporting all variants of these
kusano 7d535a
processes, although some uncommon parameter settings aren't implemented yet.
kusano 7d535a
We have made no provision for supporting the hierarchical or lossless
kusano 7d535a
processes defined in the standard.
kusano 7d535a
kusano 7d535a
We provide a set of library routines for reading and writing JPEG image files,
kusano 7d535a
plus two sample applications "cjpeg" and "djpeg", which use the library to
kusano 7d535a
perform conversion between JPEG and some other popular image file formats.
kusano 7d535a
The library is intended to be reused in other applications.
kusano 7d535a
kusano 7d535a
In order to support file conversion and viewing software, we have included
kusano 7d535a
considerable functionality beyond the bare JPEG coding/decoding capability;
kusano 7d535a
for example, the color quantization modules are not strictly part of JPEG
kusano 7d535a
decoding, but they are essential for output to colormapped file formats or
kusano 7d535a
colormapped displays.  These extra functions can be compiled out of the
kusano 7d535a
library if not required for a particular application.
kusano 7d535a
kusano 7d535a
We have also included "jpegtran", a utility for lossless transcoding between
kusano 7d535a
different JPEG processes, and "rdjpgcom" and "wrjpgcom", two simple
kusano 7d535a
applications for inserting and extracting textual comments in JFIF files.
kusano 7d535a
kusano 7d535a
The emphasis in designing this software has been on achieving portability and
kusano 7d535a
flexibility, while also making it fast enough to be useful.  In particular,
kusano 7d535a
the software is not intended to be read as a tutorial on JPEG.  (See the
kusano 7d535a
REFERENCES section for introductory material.)  Rather, it is intended to
kusano 7d535a
be reliable, portable, industrial-strength code.  We do not claim to have
kusano 7d535a
achieved that goal in every aspect of the software, but we strive for it.
kusano 7d535a
kusano 7d535a
We welcome the use of this software as a component of commercial products.
kusano 7d535a
No royalty is required, but we do ask for an acknowledgement in product
kusano 7d535a
documentation, as described under LEGAL ISSUES.
kusano 7d535a
kusano 7d535a
kusano 7d535a
LEGAL ISSUES
kusano 7d535a
============
kusano 7d535a
kusano 7d535a
In plain English:
kusano 7d535a
kusano 7d535a
1. We don't promise that this software works.  (But if you find any bugs,
kusano 7d535a
   please let us know!)
kusano 7d535a
2. You can use this software for whatever you want.  You don't have to pay us.
kusano 7d535a
3. You may not pretend that you wrote this software.  If you use it in a
kusano 7d535a
   program, you must acknowledge somewhere in your documentation that
kusano 7d535a
   you've used the IJG code.
kusano 7d535a
kusano 7d535a
In legalese:
kusano 7d535a
kusano 7d535a
The authors make NO WARRANTY or representation, either express or implied,
kusano 7d535a
with respect to this software, its quality, accuracy, merchantability, or
kusano 7d535a
fitness for a particular purpose.  This software is provided "AS IS", and you,
kusano 7d535a
its user, assume the entire risk as to its quality and accuracy.
kusano 7d535a
shun-iwasawa 82a8f5
This software is copyright (C) 1991-2016, Thomas G. Lane, Guido Vollbeding.
kusano 7d535a
All Rights Reserved except as specified below.
kusano 7d535a
kusano 7d535a
Permission is hereby granted to use, copy, modify, and distribute this
kusano 7d535a
software (or portions thereof) for any purpose, without fee, subject to these
kusano 7d535a
conditions:
kusano 7d535a
(1) If any part of the source code for this software is distributed, then this
kusano 7d535a
README file must be included, with this copyright and no-warranty notice
kusano 7d535a
unaltered; and any additions, deletions, or changes to the original files
kusano 7d535a
must be clearly indicated in accompanying documentation.
kusano 7d535a
(2) If only executable code is distributed, then the accompanying
kusano 7d535a
documentation must state that "this software is based in part on the work of
kusano 7d535a
the Independent JPEG Group".
kusano 7d535a
(3) Permission for use of this software is granted only if the user accepts
kusano 7d535a
full responsibility for any undesirable consequences; the authors accept
kusano 7d535a
NO LIABILITY for damages of any kind.
kusano 7d535a
kusano 7d535a
These conditions apply to any software derived from or based on the IJG code,
kusano 7d535a
not just to the unmodified library.  If you use our work, you ought to
kusano 7d535a
acknowledge us.
kusano 7d535a
kusano 7d535a
Permission is NOT granted for the use of any IJG author's name or company name
kusano 7d535a
in advertising or publicity relating to this software or products derived from
kusano 7d535a
it.  This software may be referred to only as "the Independent JPEG Group's
kusano 7d535a
software".
kusano 7d535a
kusano 7d535a
We specifically permit and encourage the use of this software as the basis of
kusano 7d535a
commercial products, provided that all warranty or liability claims are
kusano 7d535a
assumed by the product vendor.
kusano 7d535a
kusano 7d535a
kusano 7d535a
The IJG distribution formerly included code to read and write GIF files.
shun-iwasawa 82a8f5
To avoid entanglement with the Unisys LZW patent (now expired), GIF reading
shun-iwasawa 82a8f5
support has been removed altogether, and the GIF writer has been simplified
shun-iwasawa 82a8f5
to produce "uncompressed GIFs".  This technique does not use the LZW
shun-iwasawa 82a8f5
algorithm; the resulting GIF files are larger than usual, but are readable
shun-iwasawa 82a8f5
by all standard GIF decoders.
kusano 7d535a
kusano 7d535a
We are required to state that
kusano 7d535a
    "The Graphics Interchange Format(c) is the Copyright property of
kusano 7d535a
    CompuServe Incorporated.  GIF(sm) is a Service Mark property of
kusano 7d535a
    CompuServe Incorporated."
kusano 7d535a
kusano 7d535a
kusano 7d535a
REFERENCES
kusano 7d535a
==========
kusano 7d535a
kusano 7d535a
We recommend reading one or more of these references before trying to
kusano 7d535a
understand the innards of the JPEG software.
kusano 7d535a
kusano 7d535a
The best short technical introduction to the JPEG compression algorithm is
shun-iwasawa 82a8f5
        Wallace, Gregory K.  "The JPEG Still Picture Compression Standard",
shun-iwasawa 82a8f5
        Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44.
kusano 7d535a
(Adjacent articles in that issue discuss MPEG motion picture compression,
kusano 7d535a
applications of JPEG, and related topics.)  If you don't have the CACM issue
shun-iwasawa 82a8f5
handy, a PDF file containing a revised version of Wallace's article is
shun-iwasawa 82a8f5
available at http://www.ijg.org/files/Wallace.JPEG.pdf.  The file (actually
kusano 7d535a
a preprint for an article that appeared in IEEE Trans. Consumer Electronics)
kusano 7d535a
omits the sample images that appeared in CACM, but it includes corrections
kusano 7d535a
and some added material.  Note: the Wallace article is copyright ACM and IEEE,
kusano 7d535a
and it may not be used for commercial purposes.
kusano 7d535a
kusano 7d535a
A somewhat less technical, more leisurely introduction to JPEG can be found in
kusano 7d535a
"The Data Compression Book" by Mark Nelson and Jean-loup Gailly, published by
kusano 7d535a
M&T Books (New York), 2nd ed. 1996, ISBN 1-55851-434-1.  This book provides
kusano 7d535a
good explanations and example C code for a multitude of compression methods
kusano 7d535a
including JPEG.  It is an excellent source if you are comfortable reading C
kusano 7d535a
code but don't know much about data compression in general.  The book's JPEG
kusano 7d535a
sample code is far from industrial-strength, but when you are ready to look
kusano 7d535a
at a full implementation, you've got one here...
kusano 7d535a
kusano 7d535a
The best currently available description of JPEG is the textbook "JPEG Still
kusano 7d535a
Image Data Compression Standard" by William B. Pennebaker and Joan L.
kusano 7d535a
Mitchell, published by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1.
kusano 7d535a
Price US$59.95, 638 pp.  The book includes the complete text of the ISO JPEG
kusano 7d535a
standards (DIS 10918-1 and draft DIS 10918-2).
kusano 7d535a
kusano 7d535a
The original JPEG standard is divided into two parts, Part 1 being the actual
kusano 7d535a
specification, while Part 2 covers compliance testing methods.  Part 1 is
kusano 7d535a
titled "Digital Compression and Coding of Continuous-tone Still Images,
kusano 7d535a
Part 1: Requirements and guidelines" and has document numbers ISO/IEC IS
kusano 7d535a
10918-1, ITU-T T.81.  Part 2 is titled "Digital Compression and Coding of
kusano 7d535a
Continuous-tone Still Images, Part 2: Compliance testing" and has document
kusano 7d535a
numbers ISO/IEC IS 10918-2, ITU-T T.83.
kusano 7d535a
kusano 7d535a
The JPEG standard does not specify all details of an interchangeable file
shun-iwasawa 82a8f5
format.  For the omitted details, we follow the "JFIF" conventions, revision
shun-iwasawa 82a8f5
1.02.  JFIF version 1 has been adopted as ISO/IEC 10918-5 (05/2013) and
shun-iwasawa 82a8f5
Recommendation ITU-T T.871 (05/2011): Information technology - Digital
shun-iwasawa 82a8f5
compression and coding of continuous-tone still images: JPEG File Interchange
shun-iwasawa 82a8f5
Format (JFIF).  It is available as a free download in PDF file format from
shun-iwasawa 82a8f5
https://www.iso.org/standard/54989.html and http://www.itu.int/rec/T-REC-T.871.
shun-iwasawa 82a8f5
A PDF file of the older JFIF 1.02 specification is available at
shun-iwasawa 82a8f5
http://www.w3.org/Graphics/JPEG/jfif3.pdf.
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
The TIFF 6.0 file format specification can be obtained from
shun-iwasawa 82a8f5
http://mirrors.ctan.org/graphics/tiff/TIFF6.ps.gz.  The JPEG incorporation
shun-iwasawa 82a8f5
scheme found in the TIFF 6.0 spec of 3-June-92 has a number of serious
shun-iwasawa 82a8f5
problems.  IJG does not recommend use of the TIFF 6.0 design (TIFF Compression
shun-iwasawa 82a8f5
tag 6).  Instead, we recommend the JPEG design proposed by TIFF Technical Note
shun-iwasawa 82a8f5
#2 (Compression tag 7).  Copies of this Note can be obtained from
kusano 7d535a
http://www.ijg.org/files/.  It is expected that the next revision
kusano 7d535a
of the TIFF spec will replace the 6.0 JPEG design with the Note's design.
kusano 7d535a
Although IJG's own code does not support TIFF/JPEG, the free libtiff library
kusano 7d535a
uses our library to implement TIFF/JPEG per the Note.
kusano 7d535a
kusano 7d535a
kusano 7d535a
ARCHIVE LOCATIONS
kusano 7d535a
=================
kusano 7d535a
kusano 7d535a
The "official" archive site for this software is www.ijg.org.
kusano 7d535a
The most recent released version can always be found there in
shun-iwasawa 82a8f5
directory "files".
kusano 7d535a
kusano 7d535a
The JPEG FAQ (Frequently Asked Questions) article is a source of some
shun-iwasawa 82a8f5
general information about JPEG.  It is available at
shun-iwasawa 82a8f5
http://www.faqs.org/faqs/jpeg-faq.
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
FILE FORMAT COMPATIBILITY
shun-iwasawa 82a8f5
=========================
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
This software implements ITU T.81 | ISO/IEC 10918 with some extensions from
shun-iwasawa 82a8f5
ITU T.871 | ISO/IEC 10918-5 (JPEG File Interchange Format-- see REFERENCES).
shun-iwasawa 82a8f5
Informally, the term "JPEG image" or "JPEG file" most often refers to JFIF or
shun-iwasawa 82a8f5
a subset thereof, but there are other formats containing the name "JPEG" that
shun-iwasawa 82a8f5
are incompatible with the DCT-based JPEG standard or with JFIF (for instance,
shun-iwasawa 82a8f5
JPEG 2000 and JPEG XR).  This software therefore does not support these
shun-iwasawa 82a8f5
formats.  Indeed, one of the original reasons for developing this free software
shun-iwasawa 82a8f5
was to help force convergence on a common, interoperable format standard for
shun-iwasawa 82a8f5
JPEG files.
shun-iwasawa 82a8f5
shun-iwasawa 82a8f5
JFIF is a minimal or "low end" representation.  TIFF/JPEG (TIFF revision 6.0 as
shun-iwasawa 82a8f5
modified by TIFF Technical Note #2) can be used for "high end" applications
shun-iwasawa 82a8f5
that need to record a lot of additional data about an image.
kusano 7d535a
kusano 7d535a
kusano 7d535a
TO DO
kusano 7d535a
=====
kusano 7d535a
kusano 7d535a
Please send bug reports, offers of help, etc. to jpeg-info@jpegclub.org.