class turicreate.Image(path=None, format='auto', **_Image__internal_kw_args)

A class whose objects contains image data, meta-data, and supports useful utility methods. This is intended to make image pre-processing easier for input into subsequent learning methods. Supports reading of JPEG and PNG formats.

path : string

The path of the location of the image file to be loaded into the Image object.

format : {‘auto’ | ‘JPG’ | ‘PNG’}, optional

Defaults to ‘auto’. A format hint for the constructor. If left as ‘auto’, constructor tries to infer file format from file extension. Otherwise, tries to decode file as whatever the format hint suggests.


>>> img = turicreate.Image('https://static.turi.com/datasets/images/sample.jpg')
>>> turicreate.SArray([img]).show()


Image.save(filename) Saves the image to a file system for later use.
Image.show() Displays the image.


Image.channels Returns the number of channels in the image stored in the Image object.
Image.height Returns the height of the image stored in the Image object.
Image.pixel_data Returns the pixel data stored in the Image object.
Image.width Returns the width of the image stored in the Image object.