Image.planes#
- Image.planes(copy: bool = False) Iterator[Image][source][source]#
Iterator for image planes
- Parameters:
copy (bool, optional) β if True each plane is an independent, C-contiguous copy, otherwise it is a view that shares its pixels with the image, defaults to False
- Return out:
image containing a single plane
- Return type:
Iterator that returns sequential image planes.
Note
By default each plane is a view that shares its pixels with the image, and is not C-contiguous. Use
copy=Truefor planes that can be drawn into, or changed without changing the image. Seeplane.Changed in version 2.5.0: Added the
copyoption.Examples
>>> from machinevisiontoolbox import Image >>> img = Image.Read("flowers4.png") # in RGB order >>> for plane in img.planes(): ... print(plane) Image: 640 x 426 (uint8), 1 anonymous plane span=[0, 255]; mean=97.9412, π=56.7939; median=91 Image: 640 x 426 (uint8), 1 anonymous plane span=[0, 255]; mean=103.689, π=54.6656; median=101 Image: 640 x 426 (uint8), 1 anonymous plane span=[0, 255]; mean=43.2257, π=43.1836; median=35
See also