Image.shape#

property Image.shape: tuple[int, int] | tuple[int, int, int][source]#

Image shape

Returns:

Shape of internal NumPy array

Return type:

2-tuple, or 3-tuple if color

Example:

>>> from machinevisiontoolbox import Image
>>> img = Image.Read('flowers1.png')
>>> img.shape
(426, 640, 3)
>>> img = Image.Read('street.png')
>>> img.shape
(851, 1280)

Note

The dimensions are in a different order compared to size.

Seealso:

size nplanes ndim iscolor