1

I'd like to brighten one of my own images for printing purposes, using a program I made.

When I use the formula: pixelBrightness^0.6 to brighten an image (0.6 being an example, and where pixelBrightness is in the normalized range 0..1), I find the very dark colours (black or near black) contrast too much with the somewhat dark colours. This is standard gamma correction.

Mathematically this makes sense, because the (b^0.6) curve 'hugs' the left wall for a bit on the graph, and only eases out half way through. See here to show what I mean. However, unfortunately, this makes the near blacks too 'contrasty'. I want the very beginning of the curve to be more like 20-30 degrees off from pure vertical.

Is there a simple formula (e.g: like pixelBrightness^0.6) which is better than gamma correction for my purposes? After the two points (start (0,0) and end (1,1)) have been defined, I preferably want a single degree of freedom to determine how 'curvy' (for want of a better word please?) the curve is (i.e.: how dissimilar to a line it is). So bezier curves (with their two degrees of freedom) are possibly out.

Dan W
  • 645
  • 1
  • 7
  • 16
  • 1
    You could try $y=x/(a(1-x)+x)$ with $a>0$, which is the one-parameter family of rational functions through $(0,0)$ and $(1,1)$. Related: http://math.stackexchange.com/q/297768/856 –  Feb 02 '15 at 17:19
  • Wonderful and so simple! Please add this as an answer (and any others you might think of). I wonder if there's any theoretical basis for this improving over the standard gamma correction technique for many purposes. – Dan W Feb 02 '15 at 17:38

1 Answers1

2

Another option: $$ y = 2hx + (1-2h)x^2 $$ This is a quadratic Bezier curve with control "values" $0,h,1$. I suggest this only because you mentioned Bezier curves. Rahul's function gives you more flexibility.

bubba
  • 43,483
  • 3
  • 61
  • 122
  • 1
    Thanks, the limits at 0 and 1 don't extend the curve very far, but thanks for your input! – Dan W Feb 07 '15 at 14:04