luma.core.image_composition¶
Composes scrollable, positionable images into another Image
New in version 1.1.0.
- class luma.core.image_composition.ComposableImage(image, position=(0, 0), offset=(0, 0))[source]¶
Bases:
objectThis class encapsulates an image and its attributes that can be rendered onto an
ImageComposition.- property height¶
- Returns
The actual height of the image, regardless its position or offset within the image composition.
- Return type
int
- image(size)[source]¶
- Parameters
size (tuple) – The width, height of the image composition.
- Returns
An image, cropped to the boundaries specified by
size.- Return type
PIL.Image.Image
- property offset¶
Getter for offset.
- Returns
A tuple containing the top,left position.
- Return type
tuple
- property position¶
Getter for position
- Returns
A tuple containing the
x,yposition.- Return type
tuple
- property width¶
- Returns
The actual width of the image, regardless its position or offset within the image composition.
- Return type
int
- class luma.core.image_composition.ImageComposition(device)[source]¶
Bases:
objectManages a composition of
ComposableImageinstances that can be rendered onto a singlePIL.Image.Image.- add_image(image)[source]¶
Adds an image to the composition.
- Parameters
image (PIL.Image.Image) – The image to add.