From: jk87377@cc.tut.fi (Kouhia Juhana)
Newsgroups: soc.culture.indian
Subject: JPEG (jpg) Pictures and how to view them -- INFO
Date: 2 Jan 1993 12:36:44 +0200
Organization: Tampere University of Technology
Distribution: world
NNTP-Posting-Host: cc.tut.fi


Instead of writing own article I loan info from the JPEG FAQ
article posted to news.answers newsgroup.
If you would like to know more on JPEG, then read the original JPEG
FAQ. To get the FAQ via e-mail type:

  mail mail-server@rtfm.mit.edu
  Subject: any text

  send usenet/news.answers/jpeg-faq

No signature....


Many people have asked how to view those jpeg images in
nic.funet.fi:pub/culture/indian/pics/ (the same which
currently are posted to alt.binaries.pictures.misc).
Here is the info -- read this with the time.

Some notes by me for the start:

 -keep jpeg images in jpeg format -- do convert them to gif format
  temporarily only for viewing purposes if needed

 -if you plan to edit the jpeg images, be warned about big problems

 -if you are confused what to do after reading this article, then
  request help from me (jk87377@cc.tut.fi)


The original content of JPEG FAQ is:

===clip===
[1]  What is JPEG?
[2]  Why use JPEG?
[3]  When should I use JPEG, and when should I stick with GIF?
[4]  How well does JPEG compress images?
[5]  What are good "quality" settings for JPEG?
[6]  Where can I get JPEG software?
    [6A] "canned" software, viewers, etc.
    [6B] source code
[7]  What's all this hoopla about color quantization?
[8]  How does JPEG work?
[9]  What about lossless JPEG?
[10]  Why all the argument about file formats?
[11]  How do I recognize which file format I have, and what do I do about it?
[12]  What about arithmetic coding?
[13]  Does loss accumulate with repeated compression/decompression?
[14]  What are some rules of thumb for converting GIF images to JPEG?

Sections 1-6 are basic info that every JPEG user needs to know;
sections 7-14 are advanced info for the curious.
===clip===

Below you find maybe edited text for the sections.



[1]  What is JPEG?

JPEG (pronounced "jay-peg") is a standardized image compression mechanism.
JPEG stands for Joint Photographic Experts Group, the original name of the
committee that wrote the standard.  JPEG is designed for compressing either
full-color or gray-scale digital images of "natural", real-world scenes.
It does not work so well on non-realistic images, such as cartoons or line
drawings.

[There is also MPEG for motion picture compression. MPEG-2 is for
High Definition TV == HDTV. -jk]

A useful property of JPEG is that the degree of lossiness can be varied by
adjusting compression parameters.  This means that the image maker can trade
off file size against output image quality.  You can make *extremely* small
files if you don't mind poor quality; this is useful for indexing image
archives, making thumbnail views or icons, etc. etc.  Conversely, if you
aren't happy with the output quality at the default compression setting, you
can jack up the quality until you are satisfied, and accept lesser compression.


[2]  Why use JPEG?

There are two good reasons: to make your image files smaller, and to store
24-bit-per-pixel color data instead of 8-bit-per-pixel data [Like GIF -jk].
(If you are comparing GIF and JPEG, the size ratio is more like four to one.)

If your viewing software doesn't support JPEG directly, you'll have to
convert JPEG to some other format for viewing or manipulating images.


[4]  How well does JPEG compress images?

Pretty darn well.

File	   Size in bytes		Comments

ship.ppm	1145040  Original file in PPM format (no compression; 24 bits
			 or 3 bytes per pixel, plus a few bytes overhead)
ship.ppm.Z	 963829  PPM file passed through Unix compress
			 compress doesn't accomplish a lot, you'll note.
			 Other text-oriented compressors give similar results.
ship.gif	 240438  Converted to GIF with ppmquant -fs 256 | ppmtogif
			 Most of the savings is the result of losing color
			 info: GIF saves 8 bits/pixel, not 24.  (See sec. 7.)
ship.jpg95	 155622  cjpeg -Q 95    (highest useful quality setting)
			 This is indistinguishable from the 24-bit original,
			 at least to my nonprofessional eyeballs.
[This and -Q 90 is used for some indian images -jk]

ship.jpg75	  58009  cjpeg -Q 75    (default setting)
			 You have to look mighty darn close to distinguish this
			 from the original, even with both on-screen at once.
[I don't suggest this; at least you should check if something
important is lost before deleting original 24 bit images.
Increase the level if something is lost. -jk]


[5]  What are good "quality" settings for JPEG?

(Note: the quality settings discussed in this article apply to the free JPEG
software described in section 6B.  Other JPEG implementations, such as Image
Alchemy, may use a completely different quality scale.)



[6]  Where can I get JPEG software?

[6A]  If you are looking for "canned" software, viewers, etc:

The first part of this list is system-specific programs that only run on one
kind of system.  If you don't see what you want for your machine, check out
the portable JPEG software described at the end of the list.  Note that this
list concentrates on free and shareware programs that you can obtain over
Internet; but some commercial programs are listed too.

X Windows:

John Bradley's free XV (version 2.00 and up) is an excellent viewer for JPEG,
GIF, and other image formats.  It's available for FTP from export.lcs.mit.edu
or ftp.cis.upenn.edu.  The file is called 'xv-???.tar.Z' (where ??? is the
version number, currently 2.21); it is located in the 'contrib' directory on
export or the 'pub/xv' directory at upenn.  XV reduces all images to 8 bits
internally, which means it's not a real good choice if you have a 24-bit
display (you'll still get only 8-bit color).  Also, you shouldn't use XV to
convert full-color images to JPEG, because they'll get color-quantized first.
With the exception of those two limitations, XV is as good as they come.

"xli" is less featureful than XV, but it will do the right thing on 24-bit
displays.  xli is free and available from export.lcs.mit.edu, files
contrib/xli.*.  The current version is 1.10.  (At last report, the files at
export were a tar archive of 1.08 and a file of patches to bring 1.08 up to
1.10; be sure to retrieve both files.)  Alternately, you can use xloadimage
in combination with the free JPEG software described in 6B.

Another good choice for X Windows is John Cristy's free ImageMagick package,
also available from export, file contrib/ImageMagick.tar.Z.  The viewer
included in this package handles 24-bit displays correctly; for colormapped
displays, it does better (though slower) color quantization than XV or the
basic free JPEG software.

MS-DOS:

This covers plain DOS; for Windows programs, see the next heading.

One good choice is Eric Praetzel's free DVPEG, which views JPEG and GIF files.
The current version, 2.1, is available by FTP from sunee.waterloo.edu
(129.97.50.50), file pub/jpeg/viewers/dvpeg21.zip.  This is a good basic
viewer that works on either 286 or 386/486 machines.  The user interface is
not flashy, but it's functional (it does more than Hiview, for instance).
Does not work with some display cards.

Another freeware JPEG/GIF/TGA viewer is Mohammad Rezaei's Hiview.  The
current version, 1.2, is available from Simtel20 and mirror sites (see NOTE
below), file msdos/graphics/hv12.zip.  Hiview is much faster than DVPEG and
works on a fairly wide variety of display types.  However, Hiview requires a
386 or better CPU and a VCPI-compatible memory manager (QEMM386 and 386MAX
work; Windows and OS/2 do not).  Also installation is a bit tricky; read the
directions carefully!

A shareware alternative is ColorView for DOS ($30).  This is easier to
install and has a much spiffier-looking user interface than either of the
two freeware alternatives, but it also has more bugs.  (Presumably the bugs
will get shaken out in future versions --- CView/DOS is a fairly new
program.)  It is faster than DVPEG but a little slower than Hiview, at least
on my hardware.  The current version is 1.2, available from Simtel20 and
mirror sites (see NOTE below), file msdos/graphics/dcview12.zip.  Requires a
VESA graphics driver; if you don't have one, look in vesadriv.zip from the
same directory.

A second shareware alternative is Fullview, which has been kicking around
the net for a while, but I don't know any stable archive location for it.
The author tells me that a new version of Fullview will be out shortly
and it will be submitted to the Simtel20 archives at that time.

If none of these viewers work on your hardware, you'll need to use one of
the following conversion programs to convert JPEG to GIF, then view with
your favorite GIF viewer.  (If you have hi-color hardware, don't use GIF
as the intermediate format; try to find a TARGA-capable viewer instead.
VPIC5.0 is reputed to do the right thing with hi-color displays.)

The Independent JPEG Group's free JPEG converters are FTPable from Simtel20
and mirror sites (see NOTE below), file msdos/graphics/jpeg3.zip (or
jpeg3386.zip if you have a 386 and extended memory).  The same files were
posted to comp.binaries.ibm.pc (volume 18, issues 123-130) and should be
available from any c.b.i.p archive site.  These files are DOS compilations
of the free source code described in section 6B.  (Version 4 compilations
will be out shortly.)

Handmade Software offers two shareware conversion programs: Image Alchemy
and GIF2JPG/JPG2GIF (contact hsi@netcom.com for details).  The PC versions
of these programs are FTPable from Simtel20 and mirror sites (see NOTE
below), files msdos/graphics/alch16.zip and gif2jpg5.zip.  GIF2JPG/JPG2GIF
only performs JPEG<=>GIF format conversion.  Image Alchemy converts files
between these and many other formats, and can also display images on some
types of hardware.  The display option is limited and not very high quality,
so you'll still want a separate viewer program.  (CAUTION: GIF2JPG produces
a proprietary file format unless you specify -j.  Be sure to use -j if you
want to exchange JPEG files with other Usenet users.)  In my biased opinion,
the free JPEG software is a better choice than GIF2JPG/JPG2GIF; it's faster,
as good or better image quality, and free :-).  On the other hand, Image
Alchemy may be worth its price, if you need the additional conversion and
image manipulation capabilities it provides.

NOTE ABOUT SIMTEL20: The Internet's key archive site for PC-related programs
is Simtel20, full name wsmr-simtel20.army.mil (192.88.110.20).  Simtel20
runs a non-Unix operating system; where this document refers to directory
(eg) "msdos/graphics" at Simtel20, that really means "pd1:<msdos.graphics>".
If you are not physically on MILnet, you should expect rather slow FTP
transfer rates from Simtel20.  There are several Internet sites that
maintain copies (mirrors) of the Simtel20 archives; most FTP users should
go to one of the mirror sites instead.  A popular USA mirror site is
oak.oakland.edu (141.210.10.117); it keeps Simtel20 files in (eg)
"/pub/msdos/graphics".  If you have no FTP capability, you can retrieve
files from Simtel20 by e-mail; see informational postings in
comp.binaries.ibm.pc.archives to find out how.  If you are outside the USA,
consult the same newsgroup to learn where your nearest Simtel20 mirror is.

Microsoft Windows:

There are several Windows programs capable of displaying JPEG images.
(These will probably work under OS/2 also, but I have not tried it.)

JView is freeware, fairly fast, has good on-line help, and can write out the
decompressed image in Windows BMP format; but it can't create new JPEG
files, and it doesn't view GIFs.  JView also lacks some other useful
features of the shareware viewers (such as brightness adjustment), but it's
an excellent basic viewer.  The current version, 0.9, is available from
ftp.cica.indiana.edu (129.79.20.84), file pub/pc/win3/desktop/jview090.zip.
(Mirrors of this archive can be found at some other Internet sites,
including wuarchive.wustl.edu.)

WinJPEG can display GIF, Targa, and BMP files as well as JPEG; it can write
all of these formats too, so it can be used as a converter.  It has some
other nifty features including color-balance adjustment and slideshow.
On the minus side, the current version is a little slower than the current
version of JView, and it's shareware (only $15 though).  The current version
is 1.6, available from Simtel20 and mirror sites (see NOTE above), file
msdos/windows3/winjp160.zip.  (This is a slow 286-compatible version, you
can get the much faster 386-only version by registering.)

ColorView is another shareware entry ($30).  This was an early and promising
contender, but it has not been updated in some time, and at this point it
has no real advantages over WinJPEG.  If you want to try it anyway, the
current version is 0.97, available from ftp.cica.indiana.edu, file
pub/pc/win3/desktop/cview097.zip.  (I understand that a new version will
be appearing once the authors are finished with ColorView for DOS.)

The DOS conversion programs described above will run inside a Windows DOS
window.  DVPEG also works under Windows.  Note that Windows viewers are
generally slower than non-Windows viewers on the same hardware, due to
Windows' system overhead.

Macintosh:

Most Mac JPEG programs rely on Apple's JPEG implementation, which is part of
the QuickTime system extension; so you need to have QuickTime installed.
To use QuickTime, you need a 68020 or better CPU and you need to be running
System 6.0.7 or later.  (If you're running System 6, you must also install
the 32-bit QuickDraw extension; this is built-in on System 7.)  You can get
QuickTime by FTP from ftp.apple.com, file dts/mac/quicktime/quicktime.hqx.
(As of 11/92, this file contains QuickTime 1.5, which is better than QT 1.0
in several ways.  With respect to JPEG, it is marginally faster and
considerably less prone to crash when fed a corrupt JPEG file.  However,
some applications seem to have compatibility problems with QT 1.5.)

The first choice is probably JPEGView, a free program for viewing images
that are in Usenet-standard JFIF JPEG format, QuickTime's internal JPEG
format (PICT/JPEG), or GIF format.  It can also convert between the two
JPEG formats.  The current version, 2.0, is a big improvement over prior
versions.  Get it from sumex-aim.stanford.edu (36.44.0.6), file
/info-mac/app/jpeg-view-20.hqx.  Requires System 7 and QuickTime.  On 8-bit
displays, JPEGView usually produces the best color image quality of all the
currently available Mac JPEG viewers.  JPEGView can view large images in
much less memory than other Mac viewers; in fact, it's the only one that can
deal with JPEG images much over 640x480 pixels on a typical 4MB Mac.  Given
a large image, JPEGView automatically scales it down to fit on the screen,
rather than presenting scroll bars like most other viewers.  (You can zoom
in on any desired portion, though.)  Some people like this behavior, some
don't.  Overall, JPEGView's user interface is very well thought out.

GIFConverter, a shareware ($40) image viewer/converter, supports JPEG in its
latest release (2.3b2).  GIFConverter offers very nice viewing and
format-conversion features, but 2.3b2 is a beta version and may have a few
bugs still lurking.  Get it from sumex-aim.stanford.edu, file
/info-mac/art/gif/gif-converter-23b2.hqx.  GIFConverter is not better than
JPEGView 2.0 as a plain JPEG/GIF viewer, but it has more image manipulation
and format conversion capabilities, so you may find it worth its shareware
fee if you do a lot of playing around with images.  GIFConverter does *not*
require System 7, but it does need QuickTime to view JPEGs.  (This
restriction is expected to go away in the next release, whereupon
GIFConverter will become the JPEG viewer of choice for QuickTime-less Macs.)

Apple's free program PictPixie can view images in JFIF, QuickTime JPEG, and
GIF format, and can convert between these formats.  You can get PictPixie
from ftp.apple.com, file dts/mac/quicktime/qt.1.0.stuff/pictpixie.hqx.
Requires QuickTime.  PictPixie was intended as a developer's tool, and it's
really not the best choice unless you like to fool around with QuickTime.
Some of its drawbacks are that it requires lots of memory, it produces
relatively poor color image quality on anything less than a 24-bit display,
and it has a relatively unfriendly user interface.  Worse, PictPixie is an
unsupported program, meaning it has some minor bugs that Apple does not
intend to fix.  (There is an old version of PictPixie, called
PICTCompressor, floating around the net.  If you have this you should trash
it, as it's even buggier.  Also, the QuickTime Starter Kit includes a much
cleaned-up descendant of PictPixie called Picture Compressor.  Note that
Picture Compressor is NOT free and may not be distributed on the net.)

Storm Technology's Picture Decompress is a free JPEG viewer/converter.
This program is old and is much inferior to the above programs in speed,
features, image quality, and memory demands, but it will run without System
7 or QuickTime, so you may be forced to use it on older systems.  (You'll
still need 32-bit QuickDraw.)  You can get it from sumex-aim.stanford.edu,
file /info-mac/app/picture-decompress-201.hqx.  You'll also need a tool for
adjusting file type codes; you must set the type of a downloaded image file
to 'JPEG' to allow Picture Decompress to open it.

If your Mac is too old to run either QuickTime or 32-bit QuickDraw (a Mac
Plus for instance), things are pretty grim.  You can try Jeff Lewis's
Imagery JPEG, which will convert from JPEG to GIF; it's available from
sumex-aim.stanford.edu, file /info-mac/app/imagery-jpeg-gif-conv-06.hqx.
The color output quality of this program is terrible, but grayscale output
should be OK, and that's all you'll need anyway.  Things should get better
when the next release of GIFConverter comes out.

More and more commercial Mac applications are supporting JPEG, although not
all can deal with the Usenet-standard JFIF format.  Adobe Photoshop, version
2.0.1 or later, can read and write JFIF-format JPEG files (use the JPEG
plug-in from the Acquire menu).  You must set the file type of a downloaded
JPEG file to 'JPEG' to allow Photoshop to recognize it.

Amiga:

(Most programs listed in this section are stored in the AmiNet archive at
amiga.physik.unizh.ch (130.60.80.80).  There are many mirror sites of this
archive and you should try to use the closest one.  In the USA, a good
choice is wuarchive.wustl.edu; look under /mirrors/amiga.physik.unizh.ch/...)

HamLab Plus is an excellent JPEG viewer/converter, as well as being a
general image manipulation tool.  It's cheap (shareware, $20) and can read
several formats besides JPEG.  The current version is 2.0.8.  A demo version
is available from amiga.physik.unizh.ch (and mirror sites), file
amiga/gfx/edit/hamlab208d.lha.  The demo version will crop images larger
than 512x512, but it is otherwise fully functional.

Rend24 (shareware, $30) is an image renderer that can display JPEG, ILBM,
and GIF images.  The program can be used to create animations, even
capturing frames on-the-fly from rendering packages like Lightwave.  The
current version is 1.05, available from amiga.physik.unizh.ch (and mirror
sites), file amiga/os30/gfx/rend105.lha.  (Note: although this directory is
supposedly for AmigaDOS 3.0 programs, the program will also run under
AmigaDOS 1.3, 2.04 or 2.1.)

Viewtek is a free JPEG/ILBM/GIF viewer.  The current version is 1.03,
available from amiga.physik.unizh.ch (and mirror sites), file
amiga/os30/gfx/viewtek103.lha.  (Note: although this directory is supposedly
for AmigaDOS 3.0 programs, the program will run under 2.04 or 2.1.)

If you're willing to spend real money, there are several commercial packages
that support JPEG.  Two are written by Thomas Krehbiel, the author of Rend24
and Viewtek.  These are CineMorph, a standalone image morphing package, and
ImageFX, an impressive 24-bit image capture, conversion, editing, painting,
effects and prepress package that also includes CineMorph.  They are
distributed by Great Valley Products.  Another well-regarded commercial
image manipulation program is Art Department Professional.

The free IJG JPEG software is available compiled for Amigas from
amiga.physik.unizh.ch (and mirror sites) in directory amiga/gfx/conv, file
AmigaJPEG*.lha.  These programs convert JPEG to/from PPM,GIF,Targa formats.

The Amiga world is heavily infested with quick-and-dirty JPEG programs, many
based on an ancient beta-test version of the free IJG JPEG software (thanks
to a certain magazine that published same on its disk-of-the-month, without
so much as notifying the authors).  Among these are "AugJPEG", "NewAmyJPEG",
"VJPEG", and probably others I have not even heard of.  In my opinion,
anything older than IJG version 3 (March 1992) is not worth the disk space
it's stored on; if you have such a program, trash it and get something newer.

Acorn Archimedes:

!ChangeFSI, supplied with RISC OS 3 version 3.10, can convert from and view
JPEG JFIF format.  Provision is also made to convert images to JPEG,
although this must be done from the CLI rather than by double-clicking.

The latest version, 7.11, of the shareware program Translator can handle
JPEG (along with about 30 other image formats).  While older versions are
available on Archimedes bboards, the latest version is only available by
registering with the author, John Kortink, Nutterbrink 31, 7544 WJ,
Enschede, The Netherlands.  Price 35 Dutch guilders (about $22 or 10 pounds).

There's also a commercial product called !JPEG which provides JPEG read/write
functionality and direct JPEG viewing, as well as a host of other image
format conversion and processing options.  This is more expensive but not
necessarily better than the above programs.  Contact: DT Software, FREEPOST,
Cambridge, UK.  Tel: 0223 841099.


Portable software for almost any system:

If none of the above fits your situation, you can obtain and compile the free
JPEG conversion software described in 6B.  You'll also need a viewer program.
If your display is 8 bits or less, any GIF viewer will do fine; if you have a
display with more color capability, try to find a viewer that can read Targa
or PPM 24-bit image files.

If you are not reasonably handy at configuring and installing portable C
programs, you may have some difficulty installing the free source code.
Steve Davis (strat@cis.ksu.edu) has volunteered to maintain an archive of
pre-built executable versions of the free JPEG code for various machines.
His FTP archive is at ftp.cis.ksu.edu (129.130.10.80); look under /pub/JPEG
to see what he currently has.  (The administrators of this system ask that
FTP traffic be limited to non-prime hours.)  This archive is not maintained
by the Independent JPEG Group, and files in it may not represent the latest
free source code.  (Actually, Steve has gotten pretty lax about maintaining
his archive.  Any volunteers to set up a new one?)

There are numerous commercial JPEG offerings, with more popping up every
day.  I recommend that you not spend money on one of these unless you find
the available free or shareware software vastly too slow.  In that case,
purchase a hardware-assisted product.  Ask pointed questions about whether
the product complies with the final JPEG standard and about whether it can
handle the JFIF file format; many of the earliest commercial releases are
not and never will be compatible with anyone else's files.



[6B]  If you are looking for source code to work with:

Free, portable C code for JPEG compression is available from the Independent
JPEG Group, which I lead.  A package containing our source code,
documentation, and some small test files is available from several places.
The "official" archive site for this source code is ftp.uu.net (137.39.1.9
or 192.48.96.9).  Look under directory /graphics/jpeg; the current release
is jpegsrc.v4.tar.Z.  (This is a compressed TAR file; don't forget to
retrieve in binary mode.)  You can retrieve this file by FTP or UUCP.
If you are on a PC and don't know how to cope with .tar.Z format, you may
prefer ZIP format, which you can find at Simtel20 and mirror sites (see NOTE
above), file msdos/graphics/jpegsrc4.zip.  This file will also be available on
CompuServe, in the GRAPHSUPPORT forum (GO PICS), library 15, as jpsrc4.zip.
If you have no FTP access, you can retrieve the source from your nearest
comp.sources.misc archive; version 4 appeared as issues 55-72 of volume 34.
(If you don't know how to retrieve comp.sources.misc postings, see the FAQ
article "How to find sources".  This appears regularly in news.answers, or
you can get it by sending e-mail to mail-server@rtfm.mit.edu with
"send usenet/news.answers/finding-sources" in the body.)

The free JPEG code provides conversion between JPEG "JFIF" format and image
files in GIF, PBMPLUS PPM/PGM, Utah RLE, and Truevision Targa file formats.
The core compression and decompression modules can easily be reused in other
programs, such as image viewers.  The package is highly portable; we have
tested it on many machines ranging from PCs to Crays.

We have released this software for both noncommercial and commercial use.
Companies are welcome to use it as the basis for JPEG-related products.
We do not ask a royalty, although we do ask for an acknowledgement in
product literature (see the README file in the distribution for details).
We hope to make this software industrial-quality --- although, as with
anything that's free, we offer no warranty and accept no liability.

The Independent JPEG Group is a volunteer organization; if you'd like to
contribute to improving our software, you are welcome to join.


For more information about JPEG in general or the free JPEG software in
particular, contact the Independent JPEG Group at jpeg-info@uunet.uu.net.


			tom lane
			organizer, Independent JPEG Group
Internet: tgl@cs.cmu.edu	BITNET: tgl%cs.cmu.edu@carnegie

=====clip=====
Newsgroups: soc.culture.indian