www.Plesums.com (logo)

The Role of Gray Scale and Color
in Document Imaging

A Goal or an Intermediate Step?

©2003 by Charles A. Plesums, Austin, Texas, USA


Are we ready to move from black and white document to those with a gray scale or full color?

In the early days of digital imaging, the available technology struggled to even support simple black and white images. Computer and network technology has advanced so that gray and/or color is viable - at least for part of the process, or for specialized documents such as photographs or historical preservation. As discussed in this paper, we may not be ready to use gray or color for all of our office documents, but it may be a very useful tool for at least part of the process.

Office documents are traditionally black and white. Never mind that the original was written in blue ink or a gray pencil on yellow paper, they have always been considered black and white. Microfilm uses high contrast photographic techniques to produce images as pure black and white as possible. Office copiers use black toner on white paper, and normally consider any gray in the background a failure of the technology. Fax machines convert the document to digital images that are binary - either black or white - with no facility to transmit gray. So when digital imaging emerged almost 20 years ago, the logical assumption was pure black and white. And the technology available 20 years ago had to stretch to support even the simple binary - pure black and white - images.

User expectations are starting to change, as office documents now often include areas with shaded backgrounds, spot colors, and manual annotations such as colored marks and highlighting.

Shaded areas are not handled well with binary imaging techniques. And in the world of black and white documents, colored highlighting is much like shading. The shaded areas can

Can we move away from the traditional binary - pure black and white - document image? Has the technology changed enough that we can now consider using gray or even color?

Using Grayscale documents today

From the analysis above one could properly conclude that Grayscale image processing is very useful today as long as it isn't used for long term storage of a large number of documents, and as long as it is primarily used locally, not over a wide area network. But if I can't save it or send it, what good is it? Plenty!

Have you ever rescanned (or recopied) a document to make the image lighter or darker? Think about what happened: After the hassle of finding the original document (whether paper or microfilm), you returned to the same scanner, which used the same light source, and scanned the document in the same way. That gray scale image then goes through an initial processing, such as adjusting for the lighting. Then, just before output, the gray image is again converted to black and white, considering the setting of the automatic and/or manual brightness controls.

If the first 90% of the process is the same each time the document is scanned, then why don't we save that gray image and make the adjustments later, without rescanning? The answer lies in the history - for many years we didn't have the capacity in our computers to do that. Today we do. So in the simplest case, the gray scale image may be moved to the quality inspection station, where each image can be adjusted, just as it was at the scanner. But without rescanning.

How much can you see?

A gray image might have at least 16 shades of gray (4 bits), but more likely will have up to 256 shades of gray, based on the common use of 8 bits for computer data. If there were "only" 16 different shades of gray, most people could distinguish between the shades if they were put side-by-side. If there are 256 different shades, based on 8 bits of data, many of those shades would appear identical to most people. Generally it is agreed that most people can distinguish about 100 different shades of gray (6 bits).

Radiologists, who spend their career analyzing medical images such as x-rays, develop their ability to distinguish more shades of gray. They also "shift" the gray by putting a stronger light behind part of the image. Therefore medical images are often used at 10 or 12 bits (up to 1,000 shades of gray) rather than 4-8 bits.

The simplest process is setting the threshold - the dividing level where everything lighter is considered white, and everything darker is considered black. For example, white paper may reflect 85% if the light, and black ink on that paper may reflect 20%. So setting the threshold anywhere between 20% and 85% will give good output on that black and white document. But if blue pen or gray pencil were used, or if the lines were thin, or the pixels in the scanner don't align perfectly with the writing (they never do), then each pixel will be part line and part paper, and may reflect 40-50%. So we might adjust the contrast on the scanner so that the threshold is at 60%, and still get a good image from pen or pencil on white paper.

But what happens if one of the pages was written on colored paper - such as a yellow pad? The paper itself may only reflect 50% of the light, so if the threshold was set at 60% (as the scanner was set for the previous document) the resulting image is all black. The pixels that include writing also include some paper, so they are darker too - maybe 30-40% reflection next to the 50% reflection of the paper. So the threshold needs to be set somewhere between 40% and 50% - a different setting than for the document on white paper. But if the gray image was delivered by the scanner, rather than only setting the threshold within the scanner, we can adjust the threshold without rescanning. With the high performance of today's personal computers this is a very practical idea, even if we do not permanently save the gray image.

Why don't we just use automatic contrast adjustment, like copiers? Using the examples above, it would be fairly easy to look at the whole image and see that the one on white paper varied from 20% to 85% reflection, while the one on colored paper varied from 30% to 50% reflection. Given that information, it is possible to "spread" the gray image from the colored paper - for starters, multiply each value by 1.5 (that would help, but in practice a more sophisticated function is used). That process is not hard to implement, but few tools that allow you to convert gray to black and white currently provide an option to set the threshold. The viewer/converter needs to be part of your purchase plan.

The best process includes a localized analysis of the image - working with small parts of a page rather than the overall page. For example, if half of the page had a colored background, and the other half was white, a different threshold may be required for the different parts. One vendor proudly shows how their system handles a document with shading that varies continuously from dark to light.

Bottom line: Today's computers have the speed and capacity to handle gray documents - they no longer must have the images converted to black and white by the scanner. A few of today's scanners will now deliver either (or both) the black and white and the gray image to the connected computer, at the full speed of the scanner. The technology to analyze each page and always deliver a perfect image is well known and has been included in a few high-end products, but is not widely available (yet) in desktop programs. Therefore, when possible, buy a scanner that can deliver the gray image. Even if you cannot use it with today's software, you will have the opportunity in the future to electronically "rescan" an image without physically going back to the scanner. This is a tremendous opportunity that may have little or no extra cost if you prepare for it today.

Color Documents today

What is "Spot Color"

If an artist drew a blue block on a computer screen made of the components R=76, G=189, B=244, you would probably think "American Express" before it was completed. That particular shade of blue is used repeatedly through the American Express advertising and documents. And there are production printers that allow American Express to add spots of their special blue to their statements and other documents, without using a full color printer.

Most companies are concerned that they get just the right color in their documents, and through repeated use it becomes part of their corporate identity. A picture of an umbrella doesn't usually make you think of a company, but a red umbrella immediately invokes Travelers/Citigroup.

Printing just one color is far easier than full color printing. And that one color can be your special color. And capturing a limited set of colors in a digital image can be far easier than dealing with a full color image.

Everyone says they want color: Everyone has color displays. The cost of color printers is dropping, while the quality and performance is improving. Production printing with spot colors is becoming routine. High performance scanners are starting to support color - often at little extra cost. So what are we waiting for?

Preservation of color highlighting and annotation is the most-listed justification. But as noted above, a full-color image of a document page is at least 10 times as large as the black and white image. Not generally a problem in the local computer and network. But that can be a huge issue when we want to store millions of pages, or send images to remote users via an intranet or the Internet.

So what can we do about it? If we only need to keep a few colors, those unique colors can be stored in a separate layer of the image. It might be a layer with a precise color, like the spot colors used for corporate identity. Or it may just be a distinctive color like the yellow used in highlighting or the notes with a red pen. If the highlighting were stored as a separate scanned layer, the smoothness of the edges isn't critical, so a very low resolution image is sufficient. The color (hue, intensity) can even be stored separately, so the highlighting becomes tiny, rather than the huge impact of going to a full color document. And the rest of the document could be stored using the proven black and white techniques.

Is anyone working with layers? It's getting close. There are a few vendors with proprietary techniques. But JPEG 2000, the second generation color compression, also defined a multilayer JPEG that was not in the initial release of the standard. A scanned image is broken into sections or layers using technology that has become routine in OCR processing. And the different sections or layers are compressed using the most appropriate technology. The results for a document with highlighting, spot color, and a small picture, are almost as small as a black and white document. JPEG files have the extension .jpg for original JPEG, and .j2k or .jp2 for JPEG 2000, but watch for the mulitlayer JPEG 2000 files that will probably have an extension .jpm. Customer demand will move this technology forward - ask for it!

Back to the home page at www.plesums.com

Back to the Document Imaging index at www.plesums.com

Send e-mail comments to Charlie@Plesums.com

©2003 by Charles A. Plesums, Austin, Texas USA. ALL RIGHTS RESERVED. If you would like to make or distribute copies of this document, a nominal royalty payment is required, as specified on www.plesums.com.