I am currently learning more on the math behind image compositing and I have been playing around with the concept of gamma and gamma correction. The concept of gamma can be confusing but in fact it isn´t to hard to grasp. A basic understanding is crucial if you work with compositing or grading of images.
I wanted to understand the math behind the gamma curve and it turns out it is quite simple. It is really just taking an input value to the power of the gamma value to get the output value. I played around with processing and wrote a little sketch. Then I wrote a similar script using html5 and the canvas. Here you will find a html5 version of my gamma curve playground.