HeifImage object¶
- class pillow_heif.HeifImage(c_image)[source]¶
- Bases: - BaseImage- One image in a - HeifFilecontainer.- info[]: bytes¶
- Note - In HEIF orientation tag is only for information purposes and must not be used to rotate image. - EXIF metadata. Can be None 
 - info[]: list[dict]¶
- Other metadata(IPTC for example). List of dictionaries. Usual will be empty. Keys: - type: str 
- content_type: str 
- data: bytes 
 
 - info[]: bool¶
- A boolean value that specifies whether the image is the main image when the file contains more than one image. 
 - info[]: int¶
- Shows the bit-depth of image in file(not the decoded one, so it may differs from bit depth of mode). Possible values: 8, 10 and 12. 
 - info[]: dict¶
- NCLX color profile. Can be absent. Keys: - color_primaries: - HeifColorPrimaries
- transfer_characteristics: - HeifTransferCharacteristics
- matrix_coefficients: - HeifMatrixCoefficients
- full_range_flag: bool 
 
 - info[]: list¶
- List of - HeifDepthImageif any present for image. Currently libheif does not support writing of them, only reading.
 - property premultiplied_alpha: bool¶
- Truefor images with- premultiplied alphachannel,- Falseotherwise.
 - to_pillow() Image[source]¶
- Helper method to create - Imageclass.- Returns:
- Imageclass created from an image.
 
 - get_aux_image(aux_id: int) HeifAuxImage[source]¶
- Method to retrieve the auxiliary image at the given ID. - Returns:
- a - HeifAuxImageclass instance.
 
 - property data¶
- Decodes image and returns image data. - Returns:
- bytesof the decoded image.
 
 - load() None¶
- Method to decode image. - Note - In normal cases, you should not call this method directly, when reading data or stride property of image will be loaded automatically. 
 - property stride: int¶
- Stride of the image. - Note - from 0.10.0 version this value always will have width * sizeof pixel in default usage mode. - Returns:
- An Int value indicating the image stride after decoding. 
 
 - mode: str¶
- A string which defines the type and depth of a pixel in the image: Pillow Modes - For currently supported modes by Pillow-Heif see Modes. 
 
- class pillow_heif.heif.BaseImage(c_image)[source]¶
- Bases: - object- Base class for - HeifImage,- HeifDepthImageand- HeifAuxImage.- mode: str¶
- A string which defines the type and depth of a pixel in the image: Pillow Modes - For currently supported modes by Pillow-Heif see Modes. 
 - property data¶
- Decodes image and returns image data. - Returns:
- bytesof the decoded image.
 
 - property stride: int¶
- Stride of the image. - Note - from 0.10.0 version this value always will have width * sizeof pixel in default usage mode. - Returns:
- An Int value indicating the image stride after decoding. 
 
 
- class pillow_heif.heif.HeifDepthImage(c_image)[source]¶
- Bases: - BaseImage- Class representing the depth image associated with the - HeifImageclass.- info[]: dict¶
- Represents libheif - heif_depth_representation_infostruct as a dictionary.- If someone have an example when this struct got filled let me know. 
 - to_pillow() Image[source]¶
- Helper method to create - Imageclass.- Returns:
- Imageclass created from an image.
 
 - property data¶
- Decodes image and returns image data. - Returns:
- bytesof the decoded image.
 
 - load() None¶
- Method to decode image. - Note - In normal cases, you should not call this method directly, when reading data or stride property of image will be loaded automatically. 
 - property stride: int¶
- Stride of the image. - Note - from 0.10.0 version this value always will have width * sizeof pixel in default usage mode. - Returns:
- An Int value indicating the image stride after decoding. 
 
 - mode: str¶
- A string which defines the type and depth of a pixel in the image: Pillow Modes - For currently supported modes by Pillow-Heif see Modes.