CompuServe Messages

#HD Floppy & more

    16-Nov-92 22:44:11
Fm: Richard S. Rose,M.D. 73106,1560
To: Black Belt Systems 76004,1771
Ben, I really appreciate the kind of response you give to us. You really do deserve some kind of award. The formula I posted for doing gamma correction got a little corrupted. Here's the correct version: y = ((x)*(255)^(n-1))^(1/x) This results in positive values of y which brighten the image (what is usually needed). Negative values darken the image. This reduces to y = x when n= 1. All curves above the y/x line (n>1) are parabolic until y = x = .707 at which point the curve is a quarter circle with the center at x= 255, y = 0. Then all curves above the circle are mirror image parabolas of the lower curves until the curve essentially becomes the y axis and the line defined by y = 255. If you put a graph on the screen with the y/x line going from 0 to 255, and allow the user to click anywhere on the y/x line and then drag (upwards or downwards), you can produce the necessary 'rubber-banding' display by solving for n with the cursor position supplying x and y in the following equation, n = (lnx-ln255)/(lny-ln255), and letting the first formula produce the (changing) curve. Of course, displaying the x and y coords on screen during this process would also be nice. 8) Rich