[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

An improved method for scanning documents



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I've gotten the idea into my head lately that I should start scanning
periodicals that I want to save.  It'd be another copy to have on hand, and
it'd be relatively simple to OCR them in the future if I want to quote
something.  I'm currently working on my collection of Zymurgy back issues,
but the method would also be useful for those who are scanning Apple II
documentation.

Document scanning has involved a tradeoff between resolution and bit depth
to produce files of a reasonable size.  There are two ways you could go:

1) High resolution, low bit depth.  This produces clean scans that look nice
   when printed and can be easily OCR'd, but you lose color images. 
   Depending on how low you go (1 bpp is ideal for text), you might lose
   images altogether.
2) Low resolution, high bit depth.  This keeps images intact, but text
   appears fuzzy when printed and some OCR software will choke on it.

Years ago, there was a scanning package I used called Pagis Pro that could
recognize text and image areas on a page and store them in an optimal
manner.  It even had an OCR engine so that text blocks could be stored as
text, which would really cut down page size.  It produced files in a
proprietary format, though, that wasn't easily shared with other people.  (A
reader program was freely available, but IIRC it only worked on Windows.)

DjVu is someone else's more recent attempt at solving this problem, but what
I've read about it indicates that the software that creates the files still
has some issues.  It is cross-platform, but it still requires (at a minimum)
yet another reader program.

Most of us have something installed that can render PDFs.  Why not scan
documents into that format?  While the format originated with Adobe, you
don't need their high-dollar software to create PDFs.

I've recently figured out a method that uses freely-available tools to scan
images and text and store them into PDFs that can be handled by any number
of programs (Adobe Reader, Preview.app, KPDF, etc.)  Starting with a
high-resolution, high-bit-depth scan (600 dpi, 24 bpp), text and image
blocks are identified and written to separate files.  These files are then
combined to form a one-page PDF of reasonably small size.  PDFs can be
concatenated to create multi-page documents that are easily printed or
OCR'd.

The processing method is cross-platform.  While I'm doing my scanning under
Windows, the same scripts would work under Linux and Mac OS X without much
fuss.  Installing the software the scripts need to use is easy under Windows
and Linux, and just a little bit harder under Mac OS X.

I've put up the scripts that I'm using here, as well as instructions for
their use:

http://alfter.us/files/docscanscripts.tar.gz (10K)

I've also put up a sample page that was processed with these scripts:

http://alfter.us/files/zymurgy-v29n2-p03.pdf (140K)

The scan from which the PDF was produced was somewhere on the other side of
90 megabytes, so you can see that this method yields a significant size
reduction.  Try zooming in on the text.  Try printing it out.  Try running
it through your favorite OCR software.  I think this would be the better way
to scan and preserve Apple II documents.

  _/_
 / v \ Scott Alfter (remove the obvious to send mail)
(IIGS( http://alfter.us/            Top-posting!
 \_^_/ rm -rf /bin/laden            >What's the most annoying thing on Usenet?

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFEJxE3VgTKos01OwkRAtzaAJ0RZfCt6GUXhkA1SFO/YiQFLjjCPACgiOpX
pl4Ap69H902o21Mo7S7xHXg=
=5Pdk
-----END PGP SIGNATURE-----