Sunday, December 13, 2009

Showing off one's curves

December has been a very busy month so far.  After publishing an editorial in the Wikipedia Signpost, several people approached me with an interest in undertaking digital restorations.  Some of them had never tried it before.  So this post is dedicated to one of those adventuresome and talented people.  Garrondo expressed an interest in science and in Spanish history.  So after his first effort, which went quite well, he asked for advice about choosing a second project.  The Jay I. Kislak collection of the Library of Congress rare book division was a good place to go: it includes a 1790 publication of early Spanish colonial archaeology by Antonio León y Gama.  The scanned book is 145 pages of text about Aztec science and art with one glorious fold-out illustration, reproduced above.  And thanks to excellent digitization practicesthe LoC the illustration is also available in a 37 MB TIFF version.

Garrondo liked the selection--who can blame him?  But it's a very ambitious project for a beginner.  The scan suffers from bleed-through text and the original has smudges with a distracting crease through the center.  It was also made on laid paper, which carries its own distinct pattern that makes restoration bothersome.

He came back today with an impressive first effort.

One has to view these things at full resolution to see how good his work is: Garrondo took care of the dirt and creases and bleed-through text while preserving the laid paper pattern.  The result is worthy of featured picture recognition and highly encyclopedic.  So bless him--he took my criticisms very well.

It looked like he had adjusted the histogram.  He provided a pre-histogram TIFF file for me to play with, which became a demonstration of the difference between Photoshop's auto levels feature and its curves tool.
At left is the auto levels version; at right is a manual curves adjustment.  Notice how the paper seems less dirty and the contrast is better on the snake's scales and the sun's face.  Both adjustments deal with the image's histogram, which assigns a brightness value of 0 to 255 to every pixel on an image.

Physical documents lose contrast as they age: nearly every newly produced image will have values across the entire 0 to 255 range, but older documents often have no data at the extreme ends of the histogram range.  In this instance the extreme points were 7 and 236, with minimal data toward both ends.

Auto levels chops the histogram toward the extreme points of its range--but may lose a little bit on both sides--and does a straightforward average of the remaining data.  So I suspected the auto levels had lost information on paper texture.  The simplest way to address that would be to redo levels manually, but there was more to be accomplished here.  Curves allows a nonlinear change in the histogram.  Or to express it without jargon, a curves adjustment lets the editor enhance contrast in the darker end of the range where those scales are and enhance contrast again in the midrange for the sun's face and the figures on the dial while reducing contrast at the bright end to make the paper appear cleaner.  For a closer look, here's the curves adjusted version on its own.

The result is brighter, clearer, more vivid.  Garrondo can get even better results if he puts more work into that irritating laid paper background to minimize smudge marks.  Notice how good the lower right corner looks: a similar quality on the other three corners will improve the final result.  This isn't just a matter of background detail.  Software isn't intelligent; Photoshop can't tell the difference between a historic archaeological report and a dirty smudge.  It's the human editor's task to prepare an image with informed choices so that the data is as good as possible.  Takes a lot of patience, but when it's done right the final edit feels like magic.  Like a window back in time.

Garrondo agreed to put more work into the smudge removal.  It will take a little practice for him to get used to the curves tool, but the result is worth the effort of learning.


Jeremy said...

This is actually one of the more interesting blogs I've read. I only just began perusing it, but the initial picture and music of choice made me curious. I'll be back often, I'm sure.

kd gupta said...

The sun god , see hindu philosophy where sun as is in universe

WWPAULJD said...

you work with photoshop???. nice. I used too a lot.