Python interface for libheif library providing HEIF/AVIF image processing with both standalone and Pillow plugin capabilities
Overall
score
94%
Build a tool that extracts and processes auxiliary images from HEIF/AVIF image files. Many modern HEIF files contain auxiliary images like alpha mattes, gain maps, and other metadata images that are stored alongside the main image.
@generates
def extract_aux_images(heif_path: str) -> list[dict]:
"""
Extract all auxiliary images from a HEIF file.
Args:
heif_path: Path to the HEIF/AVIF file
Returns:
List of dictionaries, each containing:
- 'aux_type': str - The type of auxiliary image
- 'aux_id': int - The ID of the auxiliary image
- 'size': tuple - (width, height) of the auxiliary image
- 'mode': str - Color mode of the auxiliary image
"""
pass
def get_aux_image_by_id(heif_path: str, aux_id: int) -> dict:
"""
Retrieve a specific auxiliary image by its ID.
Args:
heif_path: Path to the HEIF/AVIF file
aux_id: ID of the auxiliary image to retrieve
Returns:
Dictionary containing:
- 'size': tuple - (width, height) of the image
- 'mode': str - Color mode of the image
- 'data': bytes - Raw image data
Raises:
ValueError: If the auxiliary image ID is invalid
"""
passProvides support for reading HEIF/AVIF files and accessing auxiliary images.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/pypi-pillow-heifevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10