By Basar KOC & Ziya ARNAVUT SUNY Fredonia
By Basar KOC & Ziya ARNAVUT SUNY Fredonia
By Basar KOC & Ziya ARNAVUT SUNY Fredonia
Chromatic Color: All colors other than neutral colors (white, black, and the pure grays), are chromatic.
The word color in ordinary language is often used to refer exclusively to chromatic colors, e.g., color vs. black-and-white television.
2
When the visible color spectrum wavelength (400-700 nm) is broken into thirds,
RGB colors are the predominant colors.
Caution! Sometimes pixels are not stored as vectors. Instead, first is stored the complete red component, then the complete green, then blue.
Example RGB
Bit-Depth = Color-Depth
Number of Colors = 2^(Bit-depth) Bit-depth is the number of bits.
It is also called Color resolution.
Color resolution 2 colors 4 colors 8 colors 16 colors 256 colors 65,536 colors 16,777,215 colors
Calculation 2^1 = 2 2^2 = 4 2^3 = 8 2^4 = 16 2^8 = 256 2^16 = 65536 2^24 = 16.7 million
Color Palettes
Images look best
If theyre stored with as RGB images with 16,777,216 colors.
The color of the image is indexed in a palette. (a color-table) The GIF is only capable of supporting a maximum of 256 colors. Uses lossless compression algorithm.
Color Table
3 x 256 bytes at most
10
where,
11
E[a,b]: Distance between index a and index b. eR: Difference between R values of a and b indices. eG: Difference between G values of a and b indices. eB: Difference between B values of a and b indices.
Color-map table
converted
Pseudo-distance matrix
12
Encoding
X is the index value to be predicted. a, b, c are neighboring indices. Using (a, x) we determine ranking value, or error e.
Pseudo-distance matrix
13
Decoding
In error matrix E,
the index number of the first pixel at the top-left corner, call it a, is copied to I. Later we apply the following:
Receive the error signal e of the next pixel from the encoded image. In row a of the pseudo-distance matrix search the error signal value e. Emit the corresponding column value x as the original index value of the image. Let x be a and repeat the process until we reach to the end of file.
Clearly, in decoding process, we obtain original index values without any loss.
14
Decoding (cont.)
3 1 2
e12 e22
e13 e23
e14 e24
e15
..
.. .. a1 .. a2 . .. .. .. .. ..
x12 .. e12 .. .. ..
.. .. .. .. .. ..
x13 .. .. .. e13 ..
.. .. .. .. ..
a1
x1
x2
E: Encoded image
P: Pseudo-distance matrix
I: Image
Copy e11 to I(1,1) Let a1 e11 Determine x12 by searching e12 in row a1. I(1,2) x12 Let a2 x12 Determine x13 by searching e13 in row a2. I(1,3) x13 We repeat the process similarly.
15
0 Sunset
1 Serrano
1 Serrano
3 Yahoo
Sea_dusk
Before transformation
16
After transformation
17
This yields better compression gain than Huffman coder, which was originally proposed by Kuroki et al.
18
Experimental Results
Images Benjerry Books Clegg Cwheel Descent Fractal Frymire Gate Ghouse Music Netscape Party8 Pc Sea_dusk Serrano Sunset Winaw Yahoo Average W. Avg. Normalized
19
#Colors 48 7 256 256 122 256 256 84 256 8 32 12 6 46 256 204 10 229
Size 28,326 29,338 719,158 481,078 64,542 389,190 1,238,678 61,302 481,078 6,302 61,382 75,606 1,721,858 157,538 502,886 308,070 148,894 28,110 361,296
GIF 1.239 3.046 3.623 1.492 2.928 6.923 1.485 2.939 3.713 2.482 2.113 0.854 1.694 0.323 1.629 2.601 0.997 1.983 2.337 2.328 1.223
Huffman 1.789 3.901 3.161 1.915 3.153 5.72 2.089 2.987 3.802 2.885 2.297 2.273 2.605 1.025 2.07 2.197 2.47 2.498 2.713 2.695 1.415
SAC 1.218 3.447 2.808 0.984 2.765 5.335 1.373 2.471 3.219 2.305 1.922 0.778 1.723 0.052 1.389 1.59 0.98 1.818 2.01 1.974 1.037
Proposed 1.207 3.248 2.784 0.941 2.676 5.267 1.392 2.367 2.962 2.373 1.936 0.802 1.603 0.054 1.289 1.547 0.959 1.747 1.953 1.904 1.000
Thank you!
Questions?
20