Imaging Toolkit - Concepts


Alpha Channel

Most 32-bit graphics have 4 channels. The first 3 channels are the Red, Green and Blue Channels with 8 bits each. These channels carry the actual image information. The 4th 8-bit channel or the alpha channel is really a mask. It specifies how the image's pixel colors should be merged with the background pixels when the image is displayed on top of the background.

As such, alpha is commonly used to refer to the opacity of a pixel. The alpha channel extends the basic 1-bit transparency mask by allowing 8-bits or 256 levels of opacity.

 
Annotations

Annotations can be considered as additional non-image add-on data that is to be displayed together with the image data. For example, a user may wish to highlight an area of the image but does not wish for the highlight to be permanently part of the image. The highlight is implemented as an annotation and can be stored either within the image file or as an external annotation file. However, not all image formats support storing the annotations separate from the image data but within the same image file.

 

Original image of a document
without annotations
A highlight annotation (in yellow)
applied to the image


There are many types of annotations - highlights, stamps, text, lines, etc. However, there is no standard that is adhered to by the different imaging toolkit providers.


 
Anti-Alias

Anti-aliasing is the process of remove the jagged edges from the lines in an image. For example, drawing a diagonal line on a low-resolution raster display yields an undesirable "staircase" look. Anti-aliasing smoothens out the jagged edges of an image by padding pixels with intermediate colors. If black lines are drawn on a white background, anti-aliasing pads with surrounding pixels of shades of gray. If red lines are drawn, anti-aliasing is performed using pixels of shades of pink.
 

Jagged edges of the
diagonal line

Anti-alias applied



Notice that the jagged edges of the diagonal line are smoothened out when anti-alias is applied. To illustrate how this effect is produced, the image is zoomed in to allow the padding to be seen.
 

Zoomed image of the
diagonal line
Zoomed image when
anti-alias is applied


 
Dithering

Dithering is a process of overcoming physical color display limitations at the device pixel level by integrating the display output several neighboring pixels. Although a display device (especially the older ones) may only be physically able to display a limited number of colors, if the person viewing the display is sufficiently distant from the display, dithering can be performed to achieve an apparent improvement in the perceived number of colors.

For example, human vision has poor acuity for blue spatial detail but good color discrimination capability in blue. As such, dithering blue across two-by-two pixel arrays can produce four times the number of blue levels without perceptible penalty.


Effects

Effects are transform functions that are applied for artistic purposes. For example, the Posterize effect decreases the number of colors or gray-scales in an image to create a poster-like image. Another example is the Perspective effect that makes distant objects appear smaller than the objects of focus. The perspective effect also makes parallel lines appear to converge as the lines approach the horizon.


Filters

Filters are transform functions that remove a selected image data from an image based on a formula. For example, the Median filter is a spatial filter that is based on an input pixel and its 8 neighbors. The resulting value is the statistical median value of the 9 pixels in sort order. A median filter is normally used to reduce speckling noise from a gray-scale image. A major strength of the median filter is that it preserves edges better.


Gamma Correction

Monitors and cameras are inherently non-linear devices. For example, the intensity of the luminescent phosphor on the monitor display is non-linear. This means that a pixel of intensity 128 does not appear twice as bright as a pixel of intensity 64.

Gamma correction is a non-linear function that is used to correct for these non-linear display aspects. Gamma correction controls the overall brightness of an image and the ratios of the colors of red to green to blue. Images with the wrong gamma correction will either appear too bright or too dark.


Layers

Layering is a method used to produce a composite image from individual layers. Each layer can be considered as a transparent sheet which can contain image data, effects and filters; drawn on; or have elements added to it. These layer are then arranged and stacked on top of each other transparently to produce a final image.

On of the major benefits of having layers is that each layer can be processed independently of the others. Any editing, enhancements, resizing or repositioning of a single layer will not impact other parts of the composite image.

Most imaging toolkits support some kind of layering as a standard feature.


Raster versus Vector Methods

A raster image is an image that is defined by rows of pixels. Each pixel of the image is specifically defined. An example of a raster image is a bitmap. An image is a bitmap if it contains a value for each of its pixels. A bitmap is a map consisting of rows and columns of pixels. The value of each pixel is stored in one or more bits of data. For black and white images, 1 bit is sufficient to represent each pixel. For colors and grayscale, more than 1 bit is required to represent each pixel - e.g. 8 bits or 24 bits for each pixel.

The raster method of representing images is very much opposed to vector method in which images are defined using a series of polygon nodes joined by lines. Each image is self-contained with properties such as color, shape, outline, size, and position on the screen. As such, vector images can have its properties changed multiple time while retaining the original clarity and crispness of the image. Also, vector-based images are resolution independent and the images appear at the maximum resolution of the output device - e.g. printer or monitor.

 
Transparency

Transparency is an attribute that is designated to certain areas or pixels of an image to specify that that area or pixel has no color information. As such, when the image is displayed, the container displaying the image displays does not display any image information in the transparent area but instead displays the background color. Transparency is typically implemented by using a simple 1-bit (Transparent/Not Transparent) mask to specify whether an area or a pixel is transparent.
 

A non-transparent white-background
image containing the letter A
placed on a blue background
The white background of the image
is defined as transparent and then
placed on a blue background


Transparency is especially useful as it allows the creation of rectangular objects that appear as if they are irregular in shape. This is achieved by defining the border rectangular edges as transparent so that the background shows through. Not all image formats support transparency.




 


  Developer's Corner
 
Introduction
Imaging Toolkits
TWAIN
Image Formats
Color Spaces
Auto Recognition
Useful Links