One of the techniques that we tried for image contrasting was using a "brightness differential" which is a parameter to check the range of the brightness of input image. It is defined as the difference between intensities of two pixels of image. Our intuition is to change a pixel’s intensity value accordingly to the brightness differential of that pixel with its neighbor.
After summing up all the brightness differential of the pixel with its neighbor, we compare it with a threshold. If the value is greater than the threshold, we add a slight tint or whiteness to the pixel because the pixel is lighter compared to its neighbor. Otherwise, we add a shade or blackness to the pixel to make it darker compared to its neighbor. In a nutshell, our method increases the contrast of the image by adding tint or shade to pixel value based on a pool of neighboring pixel values.
This technique can be represented by the following mathematical formulation:
Shade
Tint
A potential drawback of this method is that it often outputs noisy images. It is because the algorithm loops over the image pixel by pixel which leads to some noise.
Image of Fruits Before Contrasting
Image of Fruits After Contrasting
Image of Valley Before Contrasting
Image of Valley After Contrasting
Image of Reindeer Before Contrasting
Image of Reindeer After Contrasting
Image of Person Before Contrasting
Image of Person After Contrasting
Image of Scenery Before Contrasting
Image of Scenery After Contrasting
Image of Text Before Contrasting
Image of Text After Contrasting