User Tools

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
isp:vibrancy [2019/05/09 00:16] – [Vector's magnitude] Igor Yefmovisp:vibrancy [2019/05/09 00:24] – [Implementation overview (HSL color space)] Igor Yefmov
Line 82: Line 82:
 ===== Implementation overview (HSL color space) ===== ===== Implementation overview (HSL color space) =====
  
-Moving to HSL for image processing has a wonderful advantage of "separation of concerns" where the 3 visual components are treated independently of each other. Correcting the Saturation is just one of such areas where moving into HSL color space provides a notable simplification in the approach. As the ''S'' component of the HSL is "just" a linear scalar value we don't need to concern ourselves with the ''UV'' square or an ''RGB'' cube and just directly approach the subject of calculating only the ''S''.+Moving to HSL for image processing has a wonderful advantage of "separation of concerns" where the 3 visual components are treated independently of each other. Correcting the Saturation is just one of such areas where moving into HSL color space provides a notable simplification in the approach. As the \(S\) component of the HSL is "just" a linear scalar value we don't need to concern ourselves with the ''UV'' square or an ''RGB'' cube and just directly approach the subject of calculating only the \(S\).
  
 As was described before the main idea of the Vibrancy is that the lowest saturated colors get the most relative boost in Saturation while highly saturated colors get progressively lower boost, up to a "no boost" for the 100% saturated colors. As was described before the main idea of the Vibrancy is that the lowest saturated colors get the most relative boost in Saturation while highly saturated colors get progressively lower boost, up to a "no boost" for the 100% saturated colors.
  
-The boost multiplier therefore depends on the vibrancy factor and the pixel's saturation:+The scale (boostmultiplier therefore depends on the vibrancy factor and the pixel's saturation: 
 +\[ 
 +scale = 1 + \frac{100 - saturation}{100} * vibrancy \\ 
 +vibrancy \in [0..1]\\ 
 +saturation \in [0..100]\% 
 +\]
 <code c++>double scale(int _s, double _vib){ // _s is in range [0..100]% <code c++>double scale(int _s, double _vib){ // _s is in range [0..100]%
   return 1. + (100 - _s) / 100. * _vib;   return 1. + (100 - _s) / 100. * _vib;
 }</code> }</code>
-Once the boost value is calculated - just apply it to the pixels:+Once the scale (boostvalue is calculated - just apply it to the pixels:
 <code c++>// pseudo-code <code c++>// pseudo-code
 void vibrancy(/*array of pixels*/image, double _vib){ void vibrancy(/*array of pixels*/image, double _vib){

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also, you acknowledge that you have read and understand our Privacy Policy. If you do not agree, please leave the website.

More information