Scanning docs

Magnus Danielson cfmd at swipnet.se
Thu Aug 24 21:01:10 CEST 2000


From: "David Halliday" <dh at synthstuff.com>
Subject: RE: Scanning docs
Date: Wed, 23 Aug 2000 21:37:59 -0700

> Unh...  How many colors deep was the GIF file - if you are scanning
> schematics, there should only be two colors and with this, GIF will far far
> outshine JPG.
> 
> JPG introduces very nasty aliases on straight lines - it was designed from
> the ground up to reproduce continuous tone images ( photographs ) and was
> never intended to be used on line art.
> 
> I seem to remember a modestly compressed 2-color JPG file being about five
> times larger than the same 2-color GIF file when properly encoded.

For schematics JPEG is just missapplying the technology... JPEG is intended for
pictures may them be colorless or not. Things like drawings requires you to
reduce the compression ration so that more components are still there for the
lossy DCT based transform will give good enough results. There was a separate
standard developed for black/white images such as drawings, this standard is
called JBIG but I have rarely seen it implemented. GIF is really an old
technology, the versions are GIF-87 and GIF-89a as some may recall, the later
is nowdays only used. These are byte oriented and uses a palette of 256
colours and then uses an Lempel-Ziv-Welch (LZW) compression technique. The LZW
is still causing patent trouble if I recall things rigth. Anyway, in order to
get around those troubles AND make use of the fact that 24-bit colours had hit
the streets the PNG format was developed. PNG contains prefilters just as the
full JPEG standard has (nobody implements the full standard in reality, there
are many options not in use and people is really runing the JFIF format, a
reduced JPEG format). PNG also uses the Lempel-Ziv compression and in fact the
GZIP compression engine is what was intended. GZIP compression normally
outruns LZW on larger datafiles and todays pictures really fall into this
category. With propper pre-filtering etc you should do even better. GIF is
really just a legacy format. TIFF is a hairy format with a number of options
and few really implement and accept all of them. For instance is the LZW
section of TIFF not commonly used. Only the raw-format TIFF seems to be
accepted widely, but that is not with any compression.

The PDF framework will just encapsule JPEGs most of the times, so the issues
relating to JPEG and compression will ripple over to PDFs aswell. I don't
recall if PDF supplied other compression schemes aswell, but it should.

My preference is like this:
When you take a photo of a synth - use JPEG.
When you scan a schematic - use PNG.
When you make a document - deliver PDF.

Cheers,
Magnus



More information about the Synth-diy mailing list