Hi,
Is gamma correction something you'd do in the code that generates the gradient, or by adjusting your monitor?
Well, it is both sort of. You can change the characteristics of your monitor,
contrast and brightness. And that can affect its gamma curve. But mostly
those changes should be constrained. To further correct a gray scale image
one would apply a gamma correction. I used a look up table, such as the
following.
IF 0 ; Gamma = 2.0
; 4 April 2013
; See MORIE.WK1 for derivation.
; 0 1 2 3 4 5 6 7 8 9 A B C D E F
Power DB 0, 16, 23, 28, 32, 36, 39, 42, 45, 48, 50, 53, 55, 58, 60, 62 ; 0
DB 64, 66, 68, 70, 71, 73, 75, 77, 78, 80, 81, 83, 84, 86, 87, 89 ; 1
DB 90, 92, 93, 94, 96, 97, 98, 100, 101, 102, 103, 105, 106, 107, 108, 109 ; 2
DB 111, 112, 113, 114, 115, 116, 117, 118, 119, 121, 122, 123, 124, 125, 126, 127 ; 3
DB 128, 129, 130, 131, 132, 133, 134, 135, 135, 136, 137, 138, 139, 140, 141, 142 ; 4
DB 143, 144, 145, 145, 146, 147, 148, 149, 150, 151, 151, 152, 153, 154, 155, 156 ; 5
DB 156, 157, 158, 159, 160, 160, 161, 162, 163, 164, 164, 165, 166, 167, 167, 168 ; 6
DB 169, 170, 170, 171, 172, 173, 173, 174, 175, 176, 176, 177, 178, 179, 179, 180 ; 7
DB 181, 181, 182, 183, 183, 184, 185, 186, 186, 187, 188, 188, 189, 190, 190, 191 ; 8
DB 192, 192, 193, 194, 194, 195, 196, 196, 197, 198, 198, 199, 199, 200, 201, 201 ; 9
DB 202, 203, 203, 204, 204, 205, 206, 206, 207, 208, 208, 209, 209, 210, 211, 211 ; A
DB 212, 212, 213, 214, 214, 215, 215, 216, 217, 217, 218, 218, 219, 220, 220, 221 ; B
DB 221, 222, 222, 223, 224, 224, 225, 225, 226, 226, 227, 228, 228, 229, 229, 230 ; C
DB 230, 231, 231, 232, 233, 233, 234, 234, 235, 235, 236, 236, 237, 237, 238, 238 ; D
DB 239, 240, 240, 241, 241, 242, 242, 243, 243, 244, 244, 245, 245, 246, 246, 247 ; E
DB 247, 248, 248, 249, 249, 250, 250, 251, 251, 252, 252, 253, 253, 254, 254, 255 ; F
ENDIF
Just take the pixel value as an index into the array and use the table value
as a corrected pixel value to display.
At the time, the best results depended on the computer being used, but were
between 2.0 and 2.5. However my current display seems to want something
much smaller. Maybe even not using a correction at all. (May require further
investigation? Drat. And two other computers purchased since then as well.)
Regards,
Steve N.