1
$\begingroup$

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.

$\endgroup$
2
  • 1
    $\begingroup$ 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: math.stackexchange.com/q/297768/856 $\endgroup$
    – user856
    Feb 2, 2015 at 17:19
  • $\begingroup$ 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. $\endgroup$
    – Dan W
    Feb 2, 2015 at 17:38

1 Answer 1

2
$\begingroup$

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.

$\endgroup$
1
  • 1
    $\begingroup$ Thanks, the limits at 0 and 1 don't extend the curve very far, but thanks for your input! $\endgroup$
    – Dan W
    Feb 7, 2015 at 14:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .