Slide 2 - Graphics and Image Data Representation
Slide 2 - Graphics and Image Data Representation
Main content
Basic Data Types
1-Bit Images 8-Bit Grey-Level Images 24-Bit Color Images 8-Bit Color Images Color Lookup Table (LUTs)
Usage
Pictures containing only simple graphics and text
Fundamentals of Multimedia Graphics and Image Data Representation (2010 Spring) 6
Plane 7
All the bitplanes make up a single byte that stores the value between 0 ~ 255
Bitplane
10
11
12
13
One 25-grey level case: left is standard, the right with grey=15
Fundamentals of Multimedia Graphics and Image Data Representation (2010 Spring) 15
17
(a)
(c)
(a): 8-bit grey image lenagray.bmp. (b): Dithered version of the image. (c): Detail of dithered version.
Fundamentals of Multimedia Graphics and Image Data Representation (2010 Spring) 18
Question?
Print an image (600*450*8bit) on a paper (8*6 inch) by a printer with 300*300 DPI, whats the size of each pixel (dots)? (300*8)*(300*6) = 2400*1800 dots (2400/600)*(1800/450) = 4*4 only 17 levels
Reduce the image size to 150*113? Reduce the gray-level from 256 to 16?
19
20
21
22
(a)
(b)
(c)
(d)
Fig. 3.5: High-resolution color and separate R, G, B color channel images. (a): Example of 24-bit color image forestfire.bmp. (b, c, d): R, G, and B color channels for this image
Fundamentals of Multimedia Graphics and Image Data Representation (2010 Spring) 23
24
26
Note the great savings in space for 8-bit images, over 24-bit ones: a 640 x 480 8-bit color image only requires 300 kB of storage, compared to 921.6 kB for a color image (again, without any compression applied).
27
28
into
Index 1
R 0
G 255
B 0
29
Grey Image
Color Image-1
Color Image-2
30
R 0 0 0 0 0 0 0 0 0 0 255 255
R 0 0 0 0 0 4 8 12 16 20 255 255
G 0 0 0 0 0 0 0 0 0 0 255 255
31
(a)
(b)
(c)
Fig. 3.10: (a): 24-bit color image lena.bmp. (b): Version with color dithering. (c): Detail of dithered version.
Fundamentals of Multimedia Graphics and Image Data Representation (2010 Spring) 32
1.6 How to Devise a Color Lookup Table Example: 8-Bit Color Image
Humans are more sensitive to R and G than to B So R=3, G=3 and B=2
33
34
1.6 How to Devise a Color Lookup Table Then each pixel in the image gets replaced by its 8-bit index.
Eg. R: 16, 48, 80, 112, 144, 176, 208, 240 G: 16, 48, 80, 112, 144, 176, 208, 240 B: 32, 96, 160, 224 A pixel with color [30, 129, 80] should be converted into: [16, 112, 96]
See an example
35
36
37
38
0 00 01 10
1 11
39
40
41
42
43
44
Raster area
11
45
D5 11010101
separator
47
48
52
53
Offset Length Contents 18 4 bytes Width 22 4 bytes Heiht 26 2 bytes Planes 28 2 bytes Bits per Pixel 30 4 bytes Compression 34 4 bytes Image size 38 4 bytes X Pixels per meter 42 4 bytes Y Pixels per meter 46 4 bytes Number of Colors 50 4 bytes Colors Important 54 (n-40) bytes OS/2 new xtentional fields
54
Reserved2
1078 Bytes
BMP 40 Bytes
Reserved1 BM
4,
LUT
56
The End
Thanks Email: junx@cs.zju.edu.cn
Class Exercises 1
Suppose we decide to quantize an 8-bit grayscale image down to just 2 bits of accuracy. What is the simplest way to do so? What ranges of byte values in the original image are mapped to what quantized values? Suppose we have a 5-bit grayscale image. What size of ordered dither matrix do we need to display the image on a 1-bit printer? Suppose we have available 24 bits per pixel for a color image. However, we notice that humans are more sensitive to R and G than to B in fact, 1.5 times more sensitive to R than to G, and 2 times more sensitive to G than to B. How could we best make use of the bits available?
Fundamentals of Multimedia Graphics and Image Data Representation (2010 Spring) 58
Answers:
Suppose we decide to quantize an 8-bit grayscale image down to just 2 bits of accuracy. What is the simplest way to do so? What ranges of byte values in the original image are mapped to what quantized values?
59
Answers:
Suppose we have a 5-bit grayscale image. What size of ordered dither matrix do we need to display the image on a 1-bit printer?
Suppose we have available 24 bits per pixel for a color image. However, we notice that humans are more sensitive to R and G than to B in fact, 1.5 times more sensitive to R than to G, and 2 times more sensitive to G than to B. How could we best make use of the bits available? Ratio is 3:2:1, so use bits 12:8:4 fro G:G:B.
Fundamentals of Multimedia Graphics and Image Data Representation (2010 Spring) 60
61