Skip to content

Latest commit

 

History

History
45 lines (32 loc) · 1.34 KB

README.md

File metadata and controls

45 lines (32 loc) · 1.34 KB

Simplest Color Balance

This is a Python implementation of Simplest Color Balance by:

  • Nicolas Limare
  • Jose-Luis Lisani
  • Jean-Michel Morel
  • Ana Belén Petro
  • Catalina Sbert

Online demo of authors

To review the work of the authors of your algorithm click on this link online demonstration.

Algorithm

The algorithm applies to images with pixel values in 8-bit integer space (min = 0, max = 255).

Use this repository

$ git clone https://github.com/JCLArriaga5/simplest-color-balance-python.git

Enter the path where the repository was cloned and install the dependencies with the following command:

$ pip install -r requirements.txt

Example

Choose the percentage of pixels saturated to black (s1) and white (s2). For example, if you choose s1=1.5% and s=1.5% then the 1.5% darkest pixels in each channel will be saturated to black, and the brightest 1.5% to white.

img = mpimg.imread('./images/lenna.png')

  s1 = 1.5
  s2 = 1.5

  print('Wait...')
  out = scb(img, s1, s2)
  plotresult(img, out)

References

  • Limare, N., Lisani, J.L., Morel, J.M., Petro, A., & Sbert, C. (2011). Simplest Color Balance. Image Processing On Line, 1, 297–315.