Skip to contents

If target.color is a character-string (e.g. "red1") are members of colors(), it will be translated into its HSV-representation. If target.color is a vector of RGB-values, it gets translated into its HSV-representation. The resulting HSV-color will be applied to all elements of pixel.array which are members of pixel.idx are translated to their HSV-representation.

Usage

apply_HSV_color_by_mask(pixel.array, pixel.idx, target.color, mask_extreme)

Arguments

pixel.array

image array as loaded via duflor::load_image()

pixel.idx

list declaring pixels to which target.color.hsv is applied

target.color

color in rgb-format 0-255, or a member of colors()

mask_extreme

by default, only the hue- and saturation-components are applied to the pixels. Set this argument to TRUE to also apply value. This will increase the contrast of the image drastically, but might result in less favorable images.)

Value

pixel.array with hsv-values of pixels at positions pixel.idx modified.

Details

Values for target.color which lie outside the RGB-range of [0-255,0-255,0-255] will be constricted to limits of the range [0,255]