You are here: Technology Image processing Grayscale images processing

Grayscale images processing

Rate this item
(2 votes)

Source data are seldom represented by snow-white paper with black lines. Rather low-grade initially, they become even worse because of long storage. In short, it is usually impossible to get a binary (black-and-white) raster file without loss of information at scanning.

The way out is applying of 256-color gray scale mode of scanning. Resulting image contains even weak pencil notes and corrections. Unfortunately, it is usually fit for manual vectorizing only..

Nevertheless, you may process such images applying semiautomatic tracers. The simples method is to combine the darkest tints (as a rule they are confined to line "crests") into a color set. Another approach is forming of a multilayer raster cover in your project..

This cover resembles a "sandwich" made of raster layers. Below is the initial grey-scale image. It is "frozen" - tracing tool don't pay attention to it. And a transparent black-and-white image made from the initial one by the mean of Binarization is placed above.

What is the advantage of this approach? The gray-scale image contains all the details of information, it is easy for understanding and has not ambiguities typical of black-and-white images. On the other hand, you may accelerate vectorizing significantly applying semiautomatic tracers. These tools "see" black lines placed on top of the grey-scale image. The lines are imperfect of course, and the tracer often asks for help, but is not difficult to "lead" it through a "dirty" zone manually looking at the grey-scale image.

It is obvious that high quality of the binary image simplifies its vectorizing. There are two ways to improve the image. The first is filtering of the raster obtained by Binarization; the second - improvement of the initial grey-scale image before Binarization.

Raster filters Diffuse and Contrast Enchancement (don't confuse with Contrast!) may be used at grey-scale image processing, separately or consecutively, depending on the state of your source image. Before filtering, it is recommended to make a copy of the initial grey-scale image and add it to the project applying the same linking parameters as for the original.

Note! Speaking about grey-scale images, we shall use the term "brightness" instead of "intensity" to make the explanation more obvious.

"Contrast Enhancement" tool

Brightness of every pixel in a grey-scale image may vary from 0 (black) to 255 (white). One could say that sliders of the filter divide the range of brightness into three parts.

All pixels of the first interval (from 0 to the left slider) receive brightness value = 0 - they become black. Similarly, all pixels of the third interval (from the right slider to 255) become white, their brightness = 255. The central interval is "stretched" evenly for the entire range of values, from 0 to 255.

Thus, moving the sliders, one may delete pale gray noise and "condense" black lines.

Gamma-correction is another way of noise deletion. If this parameter exceeds 1, stretching of the central interval is uneven. It may help to brighten remaining noise without affecting details of the image.

Below is an example of filtering use:

Initial image... ... the same after correction
How was it done?...
Step 1. Move the slider of upper boundary to the left for the input values. The aim is deletion of noise without crippling of lines and contours. We whiten the background of most empty fields in the image.
Step 2. "Condense" black lines. Don't overdo it, or the lines will be too thick...
Step 3. Increase the value of gamma-correction parameter. It clears halos around raster lines. The lines become thinner (that's useful!), small gaps may appear in them (it doesn't matter).

"Increase sharpness" tool

Whatever is the quality of initial data and performance specification of your scanner, scanning decreases image sharpness. Raster obtained by inexpensive office scanners always need sharpness improvement, and even professional drum-type facility causes blurring although automatic sharpness adjustment is provided sometimes.

So, one might say that it is always necessary to increase sharpness.

The Diffuse tool is intended to increase sharpness of the image and/or decrease (mask) noise and grain applying "microblurring". This approach is taken from traditional analogous photography - subtraction of slightly blurred copy from the original makes dark pixels darker and light - even lighter.


This parameter controls contrast improvement near existing boundaries (sharp color alternations in the image). When equal to 100%, it doubles the contrast, when 200% - increases it in 4 times, and so on.


This parameter controls the area to be considered at boundary detection. Too large value may cause the halo effect - contrast areas of another color appear around boundaries. To calculate a suitable value, divide resolution of the image in 20. For example, if the resolution is 200 DPI (dots per inch) radius value about 10 should lead to good results.


This parameter allows you to specify minimal difference of tints to be considered as boundary. Usually is is somewhere between 2 and 6.

Recommendations on use

  1. Start with Factor = 200%, and Radius = image resolution divided in 20. Make the Threshold equal to 4 - it means that neighboring pixels will not be alternated if the difference of their brightness is less than 4.
  2. If there are a lot of small details in your image, try to decrease Radius and increase Factor. And visa versa - increase Radius and decrease Factor if the image contains large objects and smooth color blends. These parameters are like swing - if you increase one of them, you should decrease another. The Threshold is intended for deletion of noise and defects but do not set it higher than 8-10.
  3. Try to vary slightly all three parameters. Do not be afraid to apply small Radius values - 3 for example.
More in this category: « Prev

Add comment

Security code