Mask: Hue and Saturation vs. Colour Range

Moderator: jsachs

Post Reply
tomczak
Posts: 1034
Joined: April 25th, 2009, 12:56 am
What is the make/model of your primary camera?: Fuji X-E2
Contact:

Mask: Hue and Saturation vs. Colour Range

Post by tomczak »

In Mask: would it be about correct to think (metaphorically at least) of the Hue and Saturation tool as being a simplified Colour Range tool operating on HSV colour model, where Brightness corresponds to V sliders, and weight and additional control points could be mimicked by H and S sliders in Colour Range?

p.s. in Help file, the last paragraph in Mask/Hue Saturation Tool ("When you click Contract,...") is probably a spill-over from Colour Range Tool help text.
Maciej Tomczak
Phototramp.com

jsachs
Posts: 2946
Joined: January 22nd, 2009, 11:03 pm

Re: Mask: Hue and Saturation vs. Colour Range

Post by jsachs »

The Hue/Saturation mask tool is both simpler and more advanced than the color range tool.

It is simpler in that it ignores variations in brightness and just pays attention to hue and saturation.

It is more advanced in that, like the selective color correction transformation, you can define control points that either add to the mask or remove from it, depending on the Brightness slider setting for each control point. The Brightness slider lets you specify the brightness of the mask for pixels that match the control point, so setting Brightness to 0% makes the mask black and setting it to 100% makes it white. You can further refine the mask by adding move control points and/or by adjusting the weights. The Hue/Saturation mask tool is closely related to the the Save As Mask option in selective color correction than it is to the color range tool.

There is an example of how to use the Hue/Saturation tool in Creating and Using Masks.pdf.
Jonathan Sachs
Digital Light & Color

tomczak
Posts: 1034
Joined: April 25th, 2009, 12:56 am
What is the make/model of your primary camera?: Fuji X-E2
Contact:

Re: Mask: Hue and Saturation vs. Colour Range

Post by tomczak »

Many thanks! Can you comment on one more practical aspect of colour range vs. hue and saturation: the former has dual sliders to control smoothness of transition between what's included and what's not. It seems that balancing brightness and weight for a control point and maybe adding control points with negative brightness could achieve this, but I don't have a good handle of it.
Maciej Tomczak
Phototramp.com

den
Posts: 836
Joined: April 25th, 2009, 6:33 pm
What is the make/model of your primary camera?: Canon EOS-350D/Fuji X100T
Location: Birch Bay near Blaine, WA USA

Re: Mask: Hue and Saturation vs. Colour Range

Post by den »

Perhaps this will help...

Here is a series of Vibrance mask images applied to the Color Wheel utiltizing weightings of 0.5, 1.0, 1.5, and 2.0 respectively where black protects skin Hue-Saturations to prevent skin colors and/or fall color leaves from turning too orange-red when saturation is increased for the other Hue-Saturations of the image ...

Color Wheel protected (black-grey) Hue-Saturations...
Protected Skin Hue-Saturations.jpg
Protected Skin Hue-Saturations.jpg (15.78 KiB) Viewed 321 times
.
Weighted Hue-Saturation masks, left to right: 0.5, 1.0, 1.5, and 2.0... ...note as the weighting is increased the skin Hue-Saturations have more gradual gradients to the other Hue-Saturations...
Hue-Saturation Vibrance Masks.jpg
Hue-Saturation Vibrance Masks.jpg (20.35 KiB) Viewed 321 times
.
A suggested script for a 0.5 weighted mask with 10 control points selected from a skin color reference chart:

----------- Vibrance H-S 0-5wt Mask.mask ------------

mask 0 nx 400 ny 150 mask_color 0 mask_transparency 5 mask_mode 0 mask_operation 0 initial_level 0 n_op 5 brush_settings 0 0 10 0 100 25 30 1 0 feather_settings 0 0 0 0 floodfill_settings 0 32 texture_settings 0 0 0 0 255 gradient_settings 0 2 0.000000 5 3 ffffff 1.000000 0 0 0 0 pinhole_settings 0 1 32 2 median_settings 0 1 1 blur_settings 0 50 curve_settings 0 2 2 0 0 255 255 0 shape_settings 0 2 2 0 0 255 255 separate_settings 0 0 0 1 0 1 0 1 0 0 ffffff 1 ffffff 1 ffffff 1 ffffff color_range_settings 0 0 ff 0 1024 0 1024 0 1024 0 1024 0 1024 0 1024 command1 operation 28 mask_mode 0 mask_operation 28 huesat 0 15 16 ffffff 1 0 ff 1 0 ffff 1 0 ff00 1 0 ffff00 1 0 ff0000 1 0 ff00ff 1 0 94aaff 0.5 1 b7c1ff 0.5 1 d5d4ff 0.5 1 8297ff 0.5 1 87afff 0.5 1 9ab9ff 0.5 1 989dff 0.5 1 7b94ff 0.5 1 a4b2ff 0.5 1 command2 operation 19 mask_mode 0 mask_operation 0 command3 operation 19 mask_mode 0 mask_operation 0 command4 operation 28 mask_mode 0 mask_operation 28 huesat 0 16 17 ffffff 1 0 ff 1 0 ffff 1 0 ff00 1 0 ffff00 1 0 ff0000 1 0 ff00ff 1 0 94aaff 0.5 1 b7c1ff 0.5 1 d5d4ff 0.5 1 8297ff 0.5 1 87afff 0.5 1 9ab9ff 0.5 1 989dff 0.5 1 7b94ff 0.5 1 a4b2ff 0.5 1 d5e6ff 0.5 1 command5 operation 19 mask_mode 0 mask_operation 0

------------------------------------------------------------------------

...den...

tomczak
Posts: 1034
Joined: April 25th, 2009, 12:56 am
What is the make/model of your primary camera?: Fuji X-E2
Contact:

Re: Mask: Hue and Saturation vs. Colour Range

Post by tomczak »

Cheers Den! I think I'm almost getting it. I start liking it even more than the Colour Range mask tool.
Maciej Tomczak
Phototramp.com

jsachs
Posts: 2946
Joined: January 22nd, 2009, 11:03 pm

Re: Mask: Hue and Saturation vs. Colour Range

Post by jsachs »

The softness of the transition between selected and not selected regions is not directly controlled as in Color Range. It depends on the weights and the proximity of other control points.
Jonathan Sachs
Digital Light & Color

den
Posts: 836
Joined: April 25th, 2009, 6:33 pm
What is the make/model of your primary camera?: Canon EOS-350D/Fuji X100T
Location: Birch Bay near Blaine, WA USA

Re: Mask: Hue and Saturation vs. Colour Range

Post by den »

An Update for consideration...

A suggested H-S Vibrance mask that is more refined with 0.1 weighting and 11 control points from a reference skin color chart and the two skin colors from the Color Checker chart:
Vibrance H-S mask 0-1wt 11pt applied to Color Wheel v1.jpg
Vibrance H-S mask 0-1wt 11pt applied to Color Wheel v1.jpg (10.96 KiB) Viewed 291 times
.
the script---------- Vibrance H-S 0-1wt 11pt Inverted Mask.mask ----------

mask 0 nx 283 ny 361 mask_color 0 mask_transparency 5 mask_mode 0 mask_operation 0 initial_level 0 n_op 2 brush_settings 0 0 10 0 100 25 30 1 0 feather_settings 0 0 0 0 floodfill_settings 0 32 texture_settings 0 0 0 0 255 gradient_settings 0 2 0.000000 5 3 ffffff 1.000000 0 0 0 0 pinhole_settings 0 1 32 2 median_settings 0 1 1 blur_settings 0 50 curve_settings 0 2 2 0 0 255 255 0 shape_settings 0 2 2 0 0 255 255 separate_settings 0 0 0 1 0 1 0 1 0 0 ffffff 1 ffffff 1 ffffff 1 ffffff color_range_settings 0 0 ff 0 1024 0 1024 0 1024 0 1024 0 1024 0 1024 command1 operation 28 mask_mode 0 mask_operation 28 huesat 0 17 18 ffffff 1 0 ff 1 0 ffff 1 0 ff00 1 0 ffff00 1 0 ff0000 1 0 ff00ff 1 0 94aaff 0.1 1 b7c1ff 0.1 1 d5d4ff 0.1 1 8297ff 0.1 1 87afff 0.1 1 9ab9ff 0.1 1 989dff 0.1 1 7b94ff 0.1 1 a4b2ff 0.1 1 8cb5ff 0.1 1 a6c2ff 0.1 1 command2 operation 19 mask_mode 0 mask_operation 0

-----------------------------------------------------------------------------------------
.
.
For comparison, I use the following Vibrance Color Range mask:
ColorRange Vibrance Mask.jpg
ColorRange Vibrance Mask.jpg (75.98 KiB) Viewed 291 times
.
the script------- HSV Vibrance 11-97 non-Skin Hues 2-90 Sat ClrRnge Mask.mask ----------

mask 0 nx 4896 ny 3264 mask_color 0 mask_transparency 2 initial_level 0 n_op 1 command1 operation 7 mask_mode 0 mask_operation 7 colorspace 0 sample ff minb1 113 maxb1 993 minb2 26 maxb2 922 minb3 0 maxb3 1024 minw1 143 maxw1 963 minw2 102 maxw2 845 minw3 0 maxw3 1024

-----------------------------------------------------------------------------------------------------------------------
.
It is obvious that the Hue-Saturation mask is more blended (smother gradients) then the Color Range mask that I have been using. Depending upon mask amount settings for black and white and the method that saturation is adjusted, both will produce similar results, usually with an Absolute Difference of around 10%-15% for 3-4 photos I tested which is not easy to detect by eye for photographic images rather than designed test images.

...den...

Post Reply