2011-06-12

Kindle 3 display: quantization and Gamma correction

The Kindel3 has a 3:4 6" (diagonal) e-ink display of  resolution 600x800x16 (i.e. 4-bit gray-level in depth).
The pixel density of the e-ink display is accordingly ca. 167dpi which is higher than that of the HP 200LX palmtop PC (137.5dpi x 117dpi).

If the non-linearity of the display may be well-modelled by the power function

    brightness = 255 * (pixel_value/255)^gamma

where brightness, pixel_value in [0,254], gamma > 0. Solving

   128  127.5 = 255 * (pixel_value/255)^gamma

(The solution is more compact using 127.5 rather than 128.)

We have

     gamma =  -ln(2) / ln ( pixel_value/255 )
     pixel_value = 255 * 2 ^(-1/gamma)


By displaying the following image on my Kindle 3, holding it at a distance such that the horizontal lines are no longer resolved by the eyes as single lines but perceived as a uniform gray field in the whole, the Gamma value of my Kindle 3 e-ink display appears to be ca. 2.3 2. (2011-06-17 Note that I have changed the value from 2.3 to 2 and this is a bit tricky.  Please feedback if you have tested your Kindle-display, or any other device with a mono-display using this chart.)


2011-06-17 by pgmgamma -w540 -h 720 -s10 -l0.42
Since trying to perceive the above horizontal line-pattern as a uniform gray field may require some practice, I've also made a dot-pattern of 50% duty-cycle as another type of stimulus for achieving the desired 50% "brightness" of the e-ink display.

2010-06-17 pgmgamma -D -w540 -h 720 -s10 -l0.42
Note that the kindle 3 picture-viewer is as "experimental" as its official status.  Displaying various images of different size one after another results in "spatial residuale fragments" left on the screen. The screen-refreshing instruction [Alt]-[G] does not always help.

"Temporal residuales" is  one of the notorious characteristics of e-ink displays. If a "ghost" of the previously displayed image is left on the screen, pressing [Alt]-[G] a couple of times usually would help cleaning up the "ghosting". The above test-images should be displayed cleanly on your e-ink screen before the gamma-correction value can be read out of the chart.  If [Alt]-[G] does not work on your Kindle, you may like to try [Alt]-[R].

Unlike most testing images found on the net, all [0,255] gray-levels are built into the images in increasing order from top to bottom.  These 256 gray levels  will be quantized into a set of 16 gray levels by the image-viewer of the Kindle.  I suspect that the built-in image viewer would perform a simple "ladder-like" quantization due to the lack of computing power.  Upon viewing the test-images, one tends to be annoyed by the edges between neighboring bands of different gray levels. This is a well-known optical illusion attributed to the discoverer Ernst Mach(1838--1916) and was later proven to be related to the circuiting how our retinal ganglion cells collect and pre-process the raw visual stimuli.  This effect is called the Mach bands (German: Machsche Streifen): The brightness within a single band tends to be perceived with a gradient while, in fact, there is only one gray-level within each of the bands.  This effect can be reproduced by applying a Laplacian  (divergence of gradient) operator to the images.

The estimated gamma-value thus may be applied to "optimize" the image-viewing condition.  Note that while most image-viewing applications accept the value as "display-gamma", some might have been programmed to read the reciprocal (1/gamma).  Since the experimental kindle-image-viewer provides no option for gamma-correction, one may wish to pre-process an image before downloading it to the Kindle, so that the images, for instance, would not appear "too dark".

Gamma-correcting a monotonic image usually means expanding the dynamic in the darker range pixel by pixel and compressing in the brighter range by applying

     y = 255 * (x/255)^gamma,       gamma < 1.

Upon doing this, however, one should keep in mind, NOT to throw away the original image, because such non-linear transformations of pixel-values are usually accompanied by information-loss of the resulted picture.  Keep in mind that gamma-correcting an image is a "provisional" measure to tailor an image for one particular set of displays and that every visualizing device comes with its own characteristic of non-linearity, thus a different gamma-value, if that can be modelled this way at all.

Therefore, the estimated gamma by inspecting the above images is more of a parameter for characterizing the e-ink display itself than a proper gamma value for a particular image file.  It is not applicable on every image and there is no rule of thumb for determining "the correct" gamma value to use, unless one knows exactly how the image had been made -- type of scanner, parameters used upon scanning, ..., etc..

For those who would like to experiment with their own test-charts, I'm appending the data as shown below:

# gamma pixel_value (gammac -L -b1 -i1 |less )
# ---------------------------------------------------------------------- 

 0.125 1
 0.143 2
 0.156 3
 0.167 4
 0.176 5
 0.185 6
 0.193 7
 0.200 8
 0.207 9
 0.214 10
 0.221 11
 0.227 12
 0.233 13
 0.239 14
 0.245 15
 0.250 16
 0.256 17
 0.261 18
 0.267 19
 0.272 20
 0.278 21
 0.283 22
 0.288 23
 0.293 24
 0.298 25
 0.304 26
 0.309 27
 0.314 28
 0.319 29
 0.324 30
 0.329 31
 0.334 32
 0.339 33
 0.344 34
 0.349 35
 0.354 36
 0.359 37
 0.364 38
 0.369 39
 0.374 40
 0.379 41
 0.384 42
 0.389 43
 0.394 44
 0.400 45
 0.405 46
 0.410 47
 0.415 48
 0.420 49
 0.425 50
 0.431 51
 0.436 52
 0.441 53
 0.447 54
 0.452 55
 0.457 56
 0.463 57
 0.468 58
 0.474 59
 0.479 60
 0.485 61
 0.490 62
 0.496 63
 0.501 64
 0.507 65
 0.513 66
 0.519 67
 0.524 68
 0.530 69
 0.536 70
 0.542 71
 0.548 72
 0.554 73
 0.560 74
 0.566 75
 0.573 76
 0.579 77
 0.585 78
 0.592 79
 0.598 80
 0.604 81
 0.611 82
 0.618 83
 0.624 84
 0.631 85
 0.638 86
 0.645 87
 0.651 88
 0.658 89
 0.666 90
 0.673 91
 0.680 92
 0.687 93
 0.695 94
 0.702 95
 0.710 96
 0.717 97
 0.725 98
 0.733 99
 0.740 100
 0.748 101
 0.756 102
 0.765 103
 0.773 104
 0.781 105
 0.790 106
 0.798 107
 0.807 108
 0.816 109
 0.824 110
 0.833 111
 0.842 112
 0.852 113
 0.861 114
 0.870 115
 0.880 116
 0.890 117
 0.900 118
 0.909 119
 0.920 120
 0.930 121
 0.940 122
 0.951 123
 0.961 124
 0.972 125
 0.983 126
 0.994 127
 1.006 128
 1.017 129
 1.029 130
 1.041 131
 1.053 132
 1.065 133
 1.077 134
 1.090 135
 1.103 136
 1.116 137
 1.129 138
 1.142 139
 1.156 140
 1.170 141
 1.184 142
 1.198 143
 1.213 144
 1.228 145
 1.243 146
 1.258 147
 1.274 148
 1.290 149
 1.306 150
 1.323 151
 1.340 152
 1.357 153
 1.374 154
 1.392 155
 1.411 156
 1.429 157
 1.448 158
 1.467 159
 1.487 160
 1.507 161
 1.528 162
 1.549 163
 1.570 164
 1.592 165
 1.615 166
 1.638 167
 1.661 168
 1.685 169
 1.710 170
 1.735 171
 1.760 172
 1.787 173
 1.814 174
 1.841 175
 1.869 176
 1.898 177
 1.928 178
 1.959 179
 1.990 180
 2.022 181
 2.055 182
 2.089 183
 2.124 184
 2.160 185
 2.197 186
 2.235 187
 2.274 188
 2.314 189
 2.356 190
 2.399 191
 2.443 192
 2.488 193
 2.535 194
 2.584 195
 2.634 196
 2.686 197
 2.740 198
 2.795 199
 2.853 200
 2.913 201
 2.975 202
 3.039 203
 3.106 204
 3.176 205
 3.248 206
 3.324 207
 3.402 208
 3.484 209
 3.570 210
 3.660 211
 3.753 212
 3.851 213
 3.954 214
 4.062 215
 4.176 216
 4.295 217
 4.421 218
 4.554 219
 4.695 220
 4.844 221
 5.002 222
 5.169 223
 5.348 224
 5.538 225
 5.741 226
 5.959 227
 6.193 228
 6.445 229
 6.718 230
 7.012 231
 7.333 232
 7.682 233
 8.065 234
 8.486 235
 8.952 236
 9.469 237
10.047 238
10.697 239
11.433 240
12.275 241
13.247 242
14.380 243
15.719 244
17.326 245
19.291 246
21.746 247
24.902 248
29.111 249
35.003 250
43.841 251
58.570 252
88.029 253
76.406 254

沒有留言:

張貼留言