Image Processing Algorithms Part 4: Brightness Adjustment

Adjusting the brightness of an image is one of the easiest image processing operations that can be done. All that is involved is adding the desired change in brightness to each of the red, green and blue colour components.

Like this:

What about the pixel.alpha? Can’t we set the alpha to (255 – 255 * factor) factor being between 0.0 and 1.0? But in that case we will only brighten the image without affecting its contrast… What do you think?

The problem with using the alpha channel to brighten an image is that it is very dependent on what is behind the image (since alpha is transparency). You would need to guarantee that whatever is behind your image is white otherwise you could end up with a situation where, for example, you might end up darkening the image if behind the image is black.

You may want to consider switching to a different colourspace such as HSL where you can adjust the lightness (L) of the image without affecting the colour. Have a look here for more information: https://en.wikipedia.org/wiki/HSL_and_HSV