ColorSpace

Function
The ColorSpace function converts an image from one color space to another color space. After the image is converted, you can use color correction functions that operate in the new color space logic for interesting effects. For example, if you place a ColorSpace node to convert from rgb to hls (hue, luminance, saturation), and then apply a ColorAdd node, the Add node’s red channel shifts your hue, instead of the red channel. The optional r, g, bWeight arguments only affect rgb to hls, or hls to rgb conversions. For command-line use, and compatibility with Shake version 2.1 scripts or earlier, use the dedicated space conversion functions CMYToRGB, HLSToRGB, HSVToRGB, RGBToCMY, RGBToHLS, RGBToHSV, RGBToYIQ, RGBToYUV, YIQToRGB, and YUVToRGB. These functions do not have arguments, with one exception: The HLS functions have optional r, g, and bWeight parameters.

Parameters
Type
Defaults
Function
in/outSpace
string
"rgb","rgb"
Selects the incoming space and the output color space. For example, if you use one ColorSpace, you probably use rgb as your inSpace, and then something like hsv to convert it to hue/saturation/value space. After doing your operations, you usually apply a second ColorSpace function, with hsv as your inSpace and rgb as your outSpace.
r/g/bWeight
float
.3, .59, .11
The weighing of the three channels for the luminace calculation in conversions involving hsl. Luminance differs from value in that luminace calculates brightness bases on the eye's perception that green is brighter than an equal value in the blue channel.

Synopsis

image ColorSpace(
  image,
  string inSpace,
  string outSpace,
  float rWeight,
  float gWeight,
  float bWeight
);

Script

image = ColorSpace( 
  image, 
  "inSpace", 
  "outSpace", 
  rWeight,
  gWeight,
  bWeight
);

Command Line

shake -colorspace "inSpace" "outSpace"

Examples

shake lisa.iff -colorspace "rgb" "hls" -add .4 0 0 -colorspace "hls" "rgb"
shake lisa.iff -rgbtohls -add .4 0 0 -hlstorgb