Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
isp:brightness [2022/04/04 23:32] – external edit 127.0.0.1 | isp:brightness [2023/09/05 04:36] – Igor Yefmov | ||
---|---|---|---|
Line 4: | Line 4: | ||
Again, in the simplest terms, increasing or reducing pixel' | Again, in the simplest terms, increasing or reducing pixel' | ||
+ | |||
+ | ===== 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 " | With that the implementation of the Brightness adjustment can be as simple as the following (where the " |