                 	 Lossless JPEG Codec
                     (Version 1.0; June 20, 1994) 

                     Kongji Huang and Brian Smith
                    Department of Computer Science
                          Cornell University

This message announces a freely distributable lossless JPEG image
compression package.  The distribution contains the source code for
JPEG lossless mode encoding and decoding, man pages that describe the
commands, and an example of lossless JPEG compressed image.  The
INSTALL file provides the installation instructions.  The distribution
is available from ftp.cs.cornell.edu in the pub/multimed/ljpg
directory.


BACKGROUND

In 1992, a joint ISO/CCITT committee known as JPEG (Joint Photographic
Experts Group) established and published the first draft international
standard (DIS) for compressing continuous-tone still images, both
grayscale and color. JPEG has defined four mode of operations,
summarized them as follows. 

(1) Sequential encoding: each image component is encoded in a single
    left-to-right, top-to-bottom scan;
(2) Progressive encoding: the image is encoded in multiple scans for 
    applications in which transmission time is long, and the viewer
    prefers to watch the image build up in multiple coarse-to-clear
    passes;
(3) Lossless encoding: the images is encoded to guarantee exact recovery
    of every source image sample value (even though the result is low
    compression compared to the lossy modes);
(4) Hierarchical encoding: the image is encoded at multiple resolutions
    so that lower-resolution versions may be accessed without first having
    to decompress the image at its full resolution.

Our lossless JPEG encoding program has an automatic prediction
selection value (PSV) selector which selects the best PSV among a user
provided or default set of PSVs. This selector guarantees the best
compression ratio for lossless JPEG.

The encoding program "pnmtoljpg" compresses a Portable Pixmap or
Portable Graymap image to a lossles JPEG (ljpg) image using the JPEG
standard (DIS) lossless mode of operation. The decoding program
"ljpgtopnm" decodes a ljpg image to either a Portable Pixmap or
Portable Graymap image depending on the number of color components
stored in the ljpg image file.

To install the programs, see INSTALL file for detail.  Command usage is
summarized in the pnmtoljpg.1 and ljpgtopnm.1 files, which are in unix
man page format.  To view these files, type "nroff -man pnmtoljpg.1" or
"nroff -man ljpgtopnm.1".  The commands "pnmtoljpg -h" and "ljpgtopnm
-h" will give you simple on line help.

If you find a bug (or better yet, fix it!), port the code to another
platform, or have suggestions for improvement, send email to
kongji@cs.cornell.edu or bsmith@cs.cornell.edu

We extend our thanks to everyone who helped to create, debug, and distribute
this software.


References

Wallace, Gregory K. "The JPEG Still Picture Compression Standard",
Communications of the ACM, April 1991 vol. 34 no. 4, pp. 30-40. A revised
version of this article is available at ftp.uu.net, graphics/jpeg/wallace.ps.Z. 

"The Data Compression book" by Mark Nelson provides a good introduction
many data compression techniques. It also includes sample source code in C.

"JPEG Still Image Data Compression Standard" by William B. Pennebaker and
Joan L. Mitchell gives a detailed description of the JPEG standard. It also
includes the text of ISO Draft International Standard (DIS).
