Login  Register

Re: [Color balance] The operation behind...

Posted by Michael Schmid on Apr 14, 2021; 12:11pm
URL: http://imagej.273.s1.nabble.com/Color-balance-The-operation-behind-tp5024606p5024608.html

Hi Kornelius,

the Color Balance sliders can do more than what the Wikipedia article
describes. The Wikipedia describes what you get with adjusting the
Maximum slider, i.e., multiplying the respective value by 255/max where
'max' is the position of the 'max' slider between 0 and 255

If you modify the min slider, the output will be
   out = 255 - (255 - in)*255/(255 - min)
where 'min' is the position of the "Minimum" slider is between 0 and 255.

Thus, if you put the min slider to 50, and the input was 168, you get
   out = 255 - (255 - 168)*255/(255 - 50) = 146.78
which will be rounded to 147.


Michael
________________________________________________________________
On 14.04.21 11:27, Kost wrote:

> Hi everybody,
>
> Today I was trying to explain the color balance correction for a RGB images
> and got stuck on understanding what operation ImageJ do when using the tool
> Image > Adjust > Color balance in a specific channel.
>
> I was reading the mathematics of color balance in Wikipedia but so far
> without success.
> https://en.wikipedia.org/wiki/Color_balance#Mathematics_of_color_balance
>
> To try to understand, I opened one image and then looked and one and only
> pixel.
> When not changing the color range in the red channel (original image), the
> values in the channels were (168, 075, 095)
> After selecting the minimum in the histogram for the channel red from 50 to
> 255 the values changed to (147, 075, 095) .
>
>
> To wrap up:*
> Original pixel value with R[0-255] = (168, 075, 095)
> Edited pixel value with R[50-255] = (147, 075, 095)
>
>
> How did ImageJ went from 168 to 147?
>
>
>
> Thanks in advance for your help :)
> Kind regards,
> Kornelius
>
>
>
> *Explanation of the notation:
> The intensity in each channel are between parentheses (R,G,B) and the
> selected range for a color channel is reported between square brackets; i.e.
> original color range in the red channel = R[0-255]
>
>
>
> --
> Sent from: http://imagej.1557.x6.nabble.com/
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html