HSL Color Model Decomposition in Blender

In the current version, Blender contains decomposition nodes only for HSV and RGB color models, but still missing nodes for HSL color model. Since I find the HSL model very useful for color manipulations, especially its lightness value, I've created both Separate HSL and Combine HSL nodes, which enables me to modify each part of the HSL model.

hsl_hsv_models.png

Both HSL and HSV(HSB) models represent a color in cylindrical coordinates. HSL stands for hue, saturation, and lightness, while HSV(HSB) stands for hue, saturation, and value(brightness). So, the difference is in representation of lighter/darker tones as visible from the picture.

HSL Nodes for Cycles Render

Basically we need to create two custom nodes. One for separating the input color into 3 parts of the HSL model, and another node for combining these parts into the color output.

hsl_nodes.png

Separate HSL Node

Because of the fact Blender already contains HSV nodes, we can use conversion from HSV to HSL model:

\begin{align*} H_\mathrm{HSL} & = H_\mathrm{HSV} \\ S_\mathrm{HSL} & = \frac{V S_\mathrm{HSV}}{1 - |2 L - 1|} \\ L & = V (1 - \frac{S_\mathrm{HSV}}{2} ) \end{align*}

This is how it looks like implemented in Blender's node editor using its essential nodes.

separate_hsl.tn.png

Combine HSL Node

To combine parts of the HSL color model back into the output color, we can utilize the conversion from HSL to HSV:

\begin{align*} H_\mathrm{HSV} & = H_\mathrm{HSL} \\ S_\mathrm{HSV} & = 2 \frac{V-L}{V} \\ V & = L + \frac{S_\mathrm{HSL} (1 - |2 L - 1|)}{2} \\ \end{align*}
combine_hsl.tn.png

Time for some procedurally generated art :)

Recently, I have played with procedurally generated patterns like Voronoi diagram. I connected them together and used that pattern to modify the saturation and lightness value of the HSL color model.

procedural_art_nodes.tn.png

And finally, you can see what I've received :)

procedural_art_01.tn.png
References

Comments

Comments powered by Disqus