Hue
(clip, float "hue", float "sat", float
"intensity", string "channels")
Version 1.0. January
2nd, 2005
Copyright (C) 2005 Wilbert Dijkhof.
contact: wilbertdijkhof at yahoo.com
Hue
is a port of Graft's Hue VirtualDub filter [Hue link]. It
let's you adjust the hue, saturation and intensity.
channels = "RYGCBM"
The selectable color flavors: red (R), yellow (Y), green (G), cyan (C), blue (B), magenta (M) and combinations (GCM, etc.).
hue = 0.0
The hue is the color flavor (restricted here to the ones listed above).
Example:
# should change pixels with red hue into yellows, but it doesn't Colorbars(300,200).ConvertToRGB32 Hue(hue=60, channels="R")
# should rotate all six hue 60 degrees (thus red into yellow, yellow into green, green into cyan, # cyan into blue, blue into magenta and magenta into red), but it doesn't Colorbars(300,200).ConvertToRGB32 Hue(hue=60, channels="RYGCBM")
sat = 1.0
The saturation (sat) is the dominance of the hue in the color. It should be noted that this is NOT the same as the saturation in the HSV color format. Setting the saturation to zero converts the clip to (R,G,B) = (Y,Y,Y) where Y is the luminance (ie Y = 0.3086*R + 0.6094*G + 0.0820*B) of the clip [*]. Setting it to one leaves the clip untouched. For values inside [0,1] it just performs linear interpolation, and for values outside [0,1] it performs linear extrapolation.
Example:
# decreases the red pixels of the clip to match the luminance Colorbars(300,200).ConvertToRGB32 Hue(sat=0, channels="R")
# doesn't do anything Colorbars(300,200).ConvertToRGB32 Hue(sat=1, channels="R")
# increases the red pixels of the clip to 255 Colorbars(300,200).ConvertToRGB32 Hue(sat=1.5, channels="R")
A pixel is called red if the hue of a pizel is red. It is defined here as follows:
The same holds for the hue of the other colors.
intensity = 1.0
The intensity indicates how light or dark a color is. Setting it to zero will decrease the red pixels (if you asked for the red color flavor) to black, and setting it to one will leave the clip untouched. Setting it higher than one will increase the red pixels to white.
[*] Usually the luminance is defined as Y = 0.299*R + 0.587*G + 0.114*B (using Rec.601 coefficients), but according Haeberli the used transformation is better for linear RGB colors.
Matrix Operations for Image Processing
(by Haeberli): I guess this is the references where the used transformations
are coming from.
Graft link: Original VirtualDub version of this plugin.
v1.0, 2nd January 2005
* requires progressive video