ColorSpace
Function
This function will convert your image from one color space to another.
After the image is converted, you can use color correction functions that
will operate in the new color space logic for interesting effects. For
example, if you place a ColorSpace to convert from rgb to
hls (hue, luminance, saturation), and then apply a Color
- Add, the Add's red channel will shift your hue,
instead of the red channel.
The optional r, g, bWeight arguments only effect rgb to
hls or hls to rgb conversions.
For command line use, and compatibility with 2.1 scripts or earlier,
there are still the dedicated space convesion functions CMYToRGB,
HLSToRGB, HSVToRGB, RGBToCMY, RGBToHLS, RGBToHSV,
RGBToYIQ, RGBToYUV, YIQToRGB, and YUVToRGB.
None of these functions has arguments, except for the HLS functions which
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
|