This was created from an assignment. I did it in GNU Octave. But, I want to try doing it in JavaScript.
There are three transformation: image negative (invert color), logarithmic transformation, and power-law (gamma) transformation.
Power-law transformation can be used for contrast streching.