For this activity we discussed the different types and formats for digital images. Most digital images can be categorized into 4 basic types, depending on the type of information the image carries:
1. Binary Images: known to be either black or white, these types of images can only carry binary information- meaning their pixel values can only be either 1 or 0. These kinds of images are usually used for document and line art, like the one below:
Figure 1. http://xkcd.com/832/ |
FileName: bw.bmp
FileSize: 75166
Format: PNG
Width: 740
Height: 1674
Depth: 8
StorageType: indexed
NumberOfColors: 2
ResolutionUnit: centimeter
XResolution: 72.000000
YResolution: 72.000000
Matrix Size: 1674 740
Grayscale Images: these are typically known as black and white images, images of this type have pixels that carry an integer value between 0(black) and 255(white). This type is usually used if there is a need to portray the image in graytones.
Figure 2. Lions Head To Head. © 2010 Nick Brandt |
FileName: grayscale.bmp
FileSize: 637478
Format: BMP
Width: 858
Height: 740
Depth: 8
StorageType: indexed
NumberOfColors: 256
ResolutionUnit: centimeter
XResolution: 28.350000
YResolution: 28.350000
Matrix Size: 740 858
FileSize: 637478
Format: BMP
Width: 858
Height: 740
Depth: 8
StorageType: indexed
NumberOfColors: 256
ResolutionUnit: centimeter
XResolution: 28.350000
YResolution: 28.350000
Matrix Size: 740 858
True color images: are images that have 3 channels, one for each of the primary colors of light. Each channel has 256 (0-255) levels and once overlaid, different colors are produced. The total number of color combinations possible for a true color image is 2563 or 1.6million+ colors these types of images are usually taken photographs and complex images like below:
Figure 3. © Ookami original art |
FileName: tcolor.bmp
FileSize: 67038
Format: JPEG
Width: 460
Height: 345
Depth: 8
StorageType: truecolor
NumberOfColors: 0
ResolutionUnit: inch
XResolution: 100.000000
YResolution: 100.000000
Matrix Size: 345 460 3
FileSize: 67038
Format: JPEG
Width: 460
Height: 345
Depth: 8
StorageType: truecolor
NumberOfColors: 0
ResolutionUnit: inch
XResolution: 100.000000
YResolution: 100.000000
Matrix Size: 345 460 3
Indexed Images: colored images whose colors are represented numbers which correspond to colors in a predetermined colormap. For this kinds of images, 2 parts are stored, 1st is the image itself and secondly is the colormap. These kinds of images thereby tend to have less color information than true color images since these images are constrained by the size of their respective colormaps. These images are usually computer generated graphics since these have limited palette of colors.
Figure 4. Clairy Clefairy Wings [Red] © Clairy |
FileName: index.bmp
FileSize: 10358
Format: BMP
Width: 79
Height: 116
Depth: 8
StorageType: indexed
NumberOfColors: 256
FileSize: 10358
Format: BMP
Width: 79
Height: 116
Depth: 8
StorageType: indexed
NumberOfColors: 256
ResolutionUnit: centimeter
XResolution: 0.000000
YResolution: 0.000000
Matrix Size: 116 79
Next is about file formats. There are 2 types of file formats used in images depending on the image compression algorithm used to create the image. One is lossless compression, and the other is lossy compression. Lossless compression is, as its name implies, a compression algorithm where no loss of information is incurred. Examples of lossless format would be TIFF and PNG.
TIFF- A flexible file format which can either be lossless or lossy. It is an image format that when used, normally does not do compression at all which makes for large file sizes.
PNG- a file format that looks for patterns to compress the file size. This compression is exactly reversible, causing no loss of information.
Lossy compression on the other hand stores the image using compression algorithms that sacrifices loss of information for smaller file sizes. Well known lossy formats include JPG and GIF.
JPG- an image format that is optimized for photographs and images with continuous tones. Has a very high compression ratio with minimal quality loss.
GIF- Compresses the image by assigning a 256 colormap for the image and replaces patterns with abreviations. This format is optimized for images with fewer colors since for images with many colors it would approximate the image using the available palette.
The main bulk of the activity is to modify an image into different types. Take the true color image above, using the SIP function im2gray we obtain:
Figure 5. Ookami grayscaled |
By grayscaling the image the color channel disappears. Now if we use the function im2bw using 0.5 as threshold:
Figure 6. Ookami black and white |
This is especially useful when scanning hand-drawn graphs. Take the graph I used for activity 1 for example:
Figure 7. Acitvity 1 Graph |
If we take its histogram:
Figure 8. Histogram of the gray level values of the graph. |
We can see that most of the light areas are above 0.5 so we use this as a threshold to obtain:
Figure 9. Black and white version of the activity 1 graph |
We can see that all that is left of the background are bits of speckles and the graph obtained had a good solid line. Lowering the threshold any lower and we would obtain a graph with broken lines. Therefore in order to remove the remaining speckles, we would need to employ other techniques than thresholding. I’m thinking of using Fourier analysis to remove the high frequencies to remove the speckles. All in all this was a demanding activity due to the extra research on types and formats. But since I was able to separate most of the background from the graph, I’d give myself 8/10.
No comments:
Post a Comment