Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
isp:contrast [2019/05/08 16:57] – Igor Yefmov | isp:contrast [2019/07/14 02:43] – Igor Yefmov | ||
---|---|---|---|
Line 4: | Line 4: | ||
Decreasing the contrast brings the shadows up and highlights down to make them closer to one another. | Decreasing the contrast brings the shadows up and highlights down to make them closer to one another. | ||
- | Essentially when the contrast is increased, the pixel' | + | Essentially when the contrast is increased, the pixel' |
- | For our purposes we are going to adjust the pixel' | + | For our purposes we are going to adjust the pixel' |
- | Assuming the '' | + | Assuming the \(L\) component to be in range \([0..100]%%\) the contrast adjustment looks like this: |
+ | \[ | ||
+ | luma = (luma - 50) * contrast^2 + 50 \\ | ||
+ | luma \in [0..100] \\ | ||
+ | contrast \in ]0..2.0]%% | ||
+ | \] | ||
<code c++>// pseudo-code | <code c++>// pseudo-code | ||
void contrast(/ | void contrast(/ | ||
for(const & pixel: image){ | for(const & pixel: image){ | ||
- | pixel.luma = std:: | + | pixel.luma = std:: |
} | } | ||
}</ | }</ | ||