or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/pillow-heif@1.1.x
tile.json

tessl/pypi-pillow-heif

tessl install tessl/pypi-pillow-heif@1.1.0

Python interface for libheif library providing HEIF/AVIF image processing with both standalone and Pillow plugin capabilities

Agent Success

Agent success rate when using this tile

94%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.45x

Baseline

Agent success rate without this tile

65%

task.mdevals/scenario-10/

Image Format Converter

A utility that converts PNG and JPEG images to HEIF format with quality control and metadata preservation.

Capabilities

Convert images to HEIF

  • Given a PNG image file path, convert it to HEIF format and save it with the same name but .heif extension @test
  • Given a JPEG image file path, convert it to HEIF format and save it with the same name but .heif extension @test

Quality control

  • When quality parameter is provided (0-100), save the converted HEIF with the specified quality level @test
  • When quality is set to -1, save as lossless HEIF @test

Metadata preservation

  • When converting an image with EXIF data, preserve the EXIF metadata in the output HEIF file @test

Implementation

@generates

API

def convert_to_heif(input_path: str, output_path: str = None, quality: int = 75) -> None:
    """
    Convert a PNG or JPEG image to HEIF format.

    Args:
        input_path: Path to the input image file (PNG or JPEG)
        output_path: Path for the output HEIF file. If None, uses input filename with .heif extension
        quality: Encoding quality (0-100, or -1 for lossless). Default is 75.

    Raises:
        FileNotFoundError: If input_path does not exist
        ValueError: If input file is not a valid PNG or JPEG image
    """
    pass

Dependencies { .dependencies }

pillow-heif { .dependency }

Provides HEIF encoding support from Pillow images.

Pillow { .dependency }

Provides image loading and manipulation capabilities.