pyface.i_pil_image module

The interface for a PIL Image.

class pyface.i_pil_image.IPILImage(adaptee, default=<class 'traits.adaptation.adaptation_error.AdaptationError'>)[source]

Bases: IImage

The interface for a image that wraps a PIL Image.

image = Instance("PIL.Image.Image")

The PIL Image instance.

class pyface.i_pil_image.MPILImage(image, **traits)[source]

Bases: HasStrictTraits

The base implementation mixin for a image that wraps a PIL Image.

image = Instance("PIL.Image.Image")

The PIL Image instance.

create_bitmap(size=None)[source]

Creates a bitmap image for this image.

Parameters

size ((int, int) or None) – The desired size as a (width, height) tuple, or None if wanting default image size.

Returns

image – The toolkit bitmap corresponding to the image and the specified size.

Return type

bitmap

create_icon(size=None)[source]

Creates an icon for this image.

Parameters

size ((int, int) or None) – The desired size as a (width, height) tuple, or None if wanting default icon size.

Returns

image – The toolkit image corresponding to the image and the specified size as an icon.

Return type

icon