adjustHsb() - Media Method

The adjustHsb() method alters the HSB levels of an image. It can be applied to images of all supported bit-depths.

Note:  This function is “selection aware”—if a selection is made, the system applies the function based on the current selection. For more information about making selections, see selection() - Media Method.

Syntax

adjustHsb(

[Hue @ <value ±255>]

[Saturation @ <value ±255>]

[Brightness @ <value ±255>]

[UseHLS @ <value true,false>]

);

Parameters

The default value for any parameter not specified is zero.

Hue - an angular color value, so the results from hue @ -255 and hue @ 255 are almost identical.

Saturation and Brightness - linear color values that set the base level for the saturation and brightness of the image.

UseHLS - if specified as true, causes the adjustment to be performed in the HLS colorspace. In this case, the Saturation parameter is interpreted as lightness and the Brightness parameter is interpreted as saturation.

Example

var image = new Media();

image.load(name @ "car.tga");

image.adjustHsb(hue @ 120, saturation @ 50, brightness @ 110);

image.save(type @ "jpeg");