Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
isp:brightness [2019/05/08 16:37] – created Igor Yefmov | isp:brightness [2023/09/05 04:36] – Igor Yefmov | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Brightness ====== | ====== Brightness ====== | ||
- | In the simplest terms the " | + | In the simplest terms the " |
Again, in the simplest terms, increasing or reducing pixel' | Again, in the simplest terms, increasing or reducing pixel' | ||
- | With that the implementation of the Brightness adjustment can be as simple as the following (where the " | + | ===== In RGB color space ===== |
+ | In RGB color space the operation is a matrix multiplication of the RGB's vector by a given " | ||
+ | |||
+ | Considering that the luminance is calculated as | ||
+ | |||
+ | \[lum = 0.2126 * R + 0.7152 * G + 0.0722 * B\] | ||
+ | |||
+ | Further consider that the brightness is simply a " | ||
+ | |||
+ | \[ | ||
+ | \begin{bmatrix} | ||
+ | R' \\ | ||
+ | G' \\ | ||
+ | B' | ||
+ | \end{bmatrix} | ||
+ | = | ||
+ | \begin{bmatrix} | ||
+ | R + 0.2126 * br \\ | ||
+ | G + 0.7152 * br \\ | ||
+ | B + 0.0722 * br | ||
+ | \end{bmatrix} | ||
+ | \] | ||
+ | |||
+ | Of course when implemented on FPGA the preference is to use integer arithmetic, which can be easily achieved by an approximation, | ||
+ | |||
+ | \[ | ||
+ | \begin{bmatrix} | ||
+ | R' \\ | ||
+ | G' \\ | ||
+ | B' | ||
+ | \end{bmatrix} | ||
+ | += | ||
+ | \begin{bmatrix} | ||
+ | 213 * br \\ | ||
+ | 715 * br \\ | ||
+ | 72 * br | ||
+ | \end{bmatrix} / 1024 | ||
+ | \] | ||
+ | |||
+ | ===== In HSL color space ===== | ||
+ | When using the HSL color space the adjustment is as simple as elementary school' | ||
+ | |||
+ | With that the implementation of the Brightness adjustment can be as simple as the following (where the " | ||
<code c++>// pseudo-code | <code c++>// pseudo-code | ||
void brightness(/ | void brightness(/ |