Image.colorize#
- Image.colorize(color=[1, 1, 1], colororder: str = 'RGB', alpha: bool | float = False) Self[source]#
Colorize a greyscale image
- Parameters:
- Returns:
color image
- Return type:
Imageinstance
The greyscale image is colorized by setting each output pixel to the product of
colorand the input pixel value.Examples
>>> from machinevisiontoolbox import Image >>> img = Image.Read('shark1.png') >>> img.colorize([1, 0, 0]) # red shark Image(size=(500, 500), dtype=uint8, nplanes=3, colororder=R:G:B) >>> img.colorize('blue') # blue shark Image(size=(500, 500), dtype=uint8, nplanes=3, colororder=R:G:B)
References
See also