Sunday, August 11, 2013

Activity 4 - Image Type and Formats

The aim of this activity is to analyze and understand basic types of digitized images. Another objective is to know the different image formats and to define each of their characteristics.

This was done by manipulating and understanding different image properties such as resolution and the histogram of the image.

I.

The first part of the activity is to observe different properties of a different images.  This first sample picture came from the internet.

Figure 1. Sun and Sky. [1]

Using the 'properties' option, I obtain the following properties for figure 1:

Sun and sky
JPEG
Dimensions : 1600 x 1200 W x L
Horizontal resolution: 96 dpi
Vertical resolution: 96 dpi

Bit depth: 24

On the other hand, i also tried analyzing sample wallpapers from my computer.

Figure 2. Penguins (taken from my computer)

Consequently, I obtained the following properties:

Penguins
JPEG
Author: Corbis
Dimensions: 1024 x 768 , W x L
Horizontal resolution: 96 dpi
Vertical resolution: 96 dpi

Bit depth: 24

There are some more other properties than that of which is available to the 'properties' option of a computer. More importantly, this activity focuses on differentiating file formats and some other properties like bit depth and file sizes.

II.
The second part is the exploration of different image file formats
Using Paint and the image in figure 1, I exported copies in bitmap format of the same image.


Figure 3. Bit depth = 1

Figure 4. Bit depth = 4

Figure 5.  Bit depth =

Figures 3-5, show images in bitmap format. Obviously, the greater the bit depth, the better color saturation and depth.

Part of the activity is a research of the descriptions of the different file formats. 

PNG - It utilizes lossless compression, meaning no image data is lost when saving or viewing the image. It is a universal format that is recognized by the World Wide Web consortium, and supported by modern web browsers.[3]

JPG always uses lossy JPG compression, but its degree is selectable, for higher quality and larger files, or lower quality and smaller files. JPG is for photo images, and is the worst possible choice for most graphics or text data.[3]

TIF - Lossless (including LZW compression option), which is considered the highest quality format for commercial work. There are no additional losses or JPG artifacts to degrade and detract from the original. TIF is the most versatile[2]

BMP - Stores color data for each pixel in the image without any compression.This method of storing image information allows for crisp, high-quality graphics, but also produces large file sizes. The JPEG and GIF formats are also bitmaps, but use image compression algorithms that can significantly decrease their file size. For this reason, JPEG and GIF images are used on the Web, while BMP images are often used for printable images. [4]

GIF - GIF images can only be saved as an 8-bit colormapped image, which means you are limited to 256 colors. One advantage that GIF has over PNG, and that it has animation support. [2]



(a)                                                                 (b)                                                          (c)

Figure 6. Histogram plots of  'sky' (figure1) (a) for 24 bit PNG, JPG, TIF, BMP (b) GIF (c) Binary

Histogram plots for png,jpg,tif, and bmp appears almost the same (but not perfectly), this result can be attributed for having the same 24-bit colors. In contrast, the histogram plots for gif and binary format occurs to be very different, having only 8-bit and 1-bit color respectively.

These are the most common file formats that are used in the internet as well as to common computer activities. The next is the exploration of its file sizes. Using Figure 1, the sun and sky image, is saved using different file formats with 24 bit depth. 

Table 1. Tabulated file sizes viewed from the image properties


These tabulated results shows that the BMP format produces bigger files, compared to GIF which consequently degrade the quality of the image with a smaller file size.

Using these information, you may opt to choose a certain image format which will suit your best interest and convenience. 


Table 2. Other relevant information lifted from [2].


In this next part, i used Image J and the 'Penguins' depicted by figure 2, to produced binary and indexed images.

Figure 7. Binary

Figure 8. indexed 2

Figure 9. indexed 64

Figure 10. indexed 256
As seen on the images, figure 6 is composed of binary (0,1) image which results to a black and white image. On the other hand the indexed image is described by a pixel values that relates to a color value within a color lookup table instead of being described as intensities. Similar from previous results, these image are arranged with relatively increasing file sizes.

III.

The last part of the activity was to explore different scilab functions as well as use them too. Some of these functions were already used doing the previous results.

imread - reads an image previously saved in your computer
imshow - shows an image produced by an array or an image itself
gray_imread, gray-scaled version of imread
im2bw - converts of image to black and white
imwrite - saves an image to your computer
histplot - shows histogram of image
imfinfo - saves an information of the specified image such as filename,filesize, file format, width, height,depth and storage type, etc.


SELF-GRADE
The activity is relatively simple and understandable, that's why i think i would deserve a 10/10 given that i produced all the required results, and understand the activity completely.


References:
[1] http://www.desicomments.com/wallpapers/wallpapers/sun-and-sky-wallpapers/
[2]http://www.scantips.com/basics09.html
[3]http://www.atalasoft.com/png
[4]http://www.techterms.com/definition/bmp

No comments:

Post a Comment