Saturday, June 26, 2010

Activity 3: Image Types and Formats

Digital images take different types and different formats. In this activity, these types and formats will be discussed and eventually find its use in image processing.

There are four basic types of images; these are binary, grayscale, truecolor and indexed images. Each type has different characteristics. The binary type of images stores picture elements in either ones or zeros. It is the smallest memory consuming type of image; however, the tradeoff for the small memory consumption is the loss of color of the image. Next is the grayscale type of images, these types of images stores picture elements to values between 0 (black) to 255 (white). The values in between 0 and 255 are converted into gradients of gray. Grayscaled images have larger memory consumption than binary images but it still has loss of color. The next type of images is the truecolor and it has the largest memory consumption of all the four basic types. From its name, the colors of the image is preserved by setting picture elements into three values; red, green and blue values. The last type is the indexed images, these images have smaller memory consumption compared to truecolored images but has high consumption compared to grayscaled images. Indexed images, as the name implies, turns red, green and blue values into index thus lowering the memory usage. The downside of indexed image is that it may lose color information due to the indexing of colors.

Now let us now discuss image formats, there is many kinds of image formats, each have its certain characteristics, but in this activity, only four image formats are discussed; BMP, PNG, JPEG and GIF.

BMP or bitmap, stores image pixels with color depth of 1, 4, 8, 16, 24 or 32 bits per pixel. A picture element in a picture minimally occupies n/8 bytes depending on the color depth.

PNG or Portable Network Graphics is a bitmapped image format that utilizes lossless data compression. Pallette-based, grayscale, grayscale with alpha, RGB, or RGBA images are supported by PNG image formats.

JPEG or Joint Picture Experts Group is a lossy compression image format. It compresses images file into 10:1 compression ratio, which, on the downside, produces loss in image quality.

GIF or Graphics Interchange Format, a bitmapped image format that supports up to 8 bits per pixel, allows up to 256 distinct colors to be referenced to a single image.

The following images are of different image type and image formats, image information immediately follows the image it refers to.


Figure 1. A truecolor image in Bitmap (.bmp) format. This image was taken from www.divegallery.com/wallpaper_3.html. The image was compressed to JPEG format for posting purposes only

FileSize: 2359352

Format: BMP

Width: 1024

Height: 768

Depth: 8

StorageType: truecolor

NumberOfColors: 0

ResolutionUnit: centimeter

XResolution: 28.34

YResolution: 28.34


Figure 2. A truecolor image in Portable Network Graphics (.png) format. This image was taken from www.sourceforge.net.

FileSize: 312111

Format: PNG

Width: 400

Height: 400

Depth: 8

StorageType: truecolor

NumberOfColors: 0

ResolutionUnit: centimeter

XResolution: 72.00

YResolution: 72.00


Figure 3. A true color image in Joint Picture Experts Group (.jpg) Format. This image was taken from www.deviantart.com.

FileSize: 166256

Format: JPEG

Width: 750

Height: 622

Depth: 8

StorageType: truecolor

NumberOfColors: 0

ResolutionUnit: centimeter

XResolution: 100.00

YResolution: 100.00

Figure 4. An indexed image in Graphics Interchange Format (.gif) format. This image was taken from someone very close to me XP.

FileSize: 18193

Format: GIF

Width: 345

Height: 245

Depth: 8

StorageType: indexed

NumberOfColors: 256

ResolutionUnit: centimeter

XResolution: 72.00

YResolution: 72.00


Applying the knowledge from image type and formats, a truecolor type image is converted to both binary and grayscale type image. The converted image is shown in figures 5 and 6 below,


Figure 5. A binary type of the image in figure 2.


Figure 6. A grayscale type of the image in figure 2.


A second truecolor image was also converted to both binary and grayscale images shown in figure 7.




Figure 7. A (left) truecolor image in its (right) binary type and in its (bottom) grayscale type. The original image was taken from http://fyfcolts.blogspot.com/2009/11/post-game-ceremony.html


Next we apply this conversion to image processing; the background of a scanned handmade plot will be separated from the plot itself. This will be accomplished by converting the image into a grayscale and thresholding it before it is converted into binary type image. This technique, however, is only applicable on plots which has no color on it, since binarized image will lose its color quality.

Figure 8. The scanned handmade plot from activity 1.


Figure 9. Grayscale version of handmade plot.


Figure 10. Histogram of the grayscale image (left) zoomed at the black values, (right) normal view, and (bottom) zoomed at the white values.


Figure 11. The binarized image of the handmade plot. The background was separated by thresholding the grayscale image before it was binarized.


This technique on separating the background from the image is very useful in cleaning scanned images from unwanted noise in the image. This removal of unwanted noise can be seen by comparing figures 8 and 11. The gray area on the top right part of the image in figure 8 is removed in figure 11.

This activity is very interesting because it is like photoshop-ing an image, the difference is in this activity is that the approach is mathematic and scientific. This activity is very interesting and I find a lot of applications for this technique. Again, I give myself a grade of 10 for enjoying and learning in this activity.

Reference:

Dr. Soriano. Applied Physics 186 activity handouts: A3 - Image Types and Formats.

No comments:

Post a Comment