| Extracted from Pike v7.8 release 866 at 2018-07-18.

[Top]
Image
Image.Image

# Method Image.Image()->modify_by_intensity()

Method modify_by_intensity

  `object modify_by_intensity(int r, int g, int b, int|array(int) ... vn)`

Description

  Recolor an image from intensity values.

  For each color an intensity is calculated, from r, g and b factors (see grey ), this gives a value between 0 and max.

  The color is then calculated from the values given, v1 representing the intensity value of 0, vn representing max, and colors between representing intensity values between, linear.

  original | ->grey()->modify_by_intensity(1,0,0, 0,({255,0,0}),({0,255,0}));

Parameter `r`
Parameter `g`
Parameter `b`

  red, green, blue intensity factors

Parameter `v1`
Parameter `vn`

  destination color

Returns

  the new image object

See also

  grey , `* , color