Python interface for libheif library providing HEIF/AVIF image processing with both standalone and Pillow plugin capabilities
Overall
score
94%
Create a command-line utility that converts images from common formats (PNG, JPEG) to HEIF and AVIF formats with customizable quality settings.
Build a Python module that provides image format conversion functionality with the following features:
The module should provide a function that converts an input image file to either HEIF or AVIF format. The function should:
The converter should support quality control:
The converter should handle images with transparency:
@generates
def convert_image(input_path: str, output_path: str, format: str, quality: int = 85) -> None:
"""
Convert an image to HEIF or AVIF format.
Args:
input_path: Path to the input image file (PNG or JPEG)
output_path: Path where the converted image will be saved
format: Target format, either "HEIF" or "AVIF"
quality: Compression quality (0-100), or -1 for lossless (default: 85)
Raises:
ValueError: If format is not "HEIF" or "AVIF"
FileNotFoundError: If input file does not exist
"""
passProvides HEIF and AVIF image encoding and decoding capabilities.
@satisfied-by
Provides core image processing functionality for reading input 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