CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-pillow-heif

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

Overall
score

94%

Overview
Eval results
Files

task.mdevals/scenario-4/

HDR Image Color Space Converter

Build a command-line tool that converts HDR images between different color spaces by manipulating their transfer characteristics. The tool should read an HDR image, modify its color profile to use a specified transfer function, and save the result.

Requirements

The tool should accept command-line arguments:

  • Input file path (HEIF/AVIF format)
  • Output file path
  • Transfer characteristic identifier (integer value per ITU-R BT.2100)

Common transfer characteristics include:

  • 16: PQ (Perceptual Quantizer - HDR10)
  • 18: HLG (Hybrid Log-Gamma - HDR broadcast)
  • 13: sRGB
  • 1: BT.709

The tool should:

  1. Read the input HDR image file
  2. Extract the current color profile information
  3. Create a new color profile with the specified transfer characteristic while preserving other color space properties
  4. Apply the modified profile to the image
  5. Save the output file with the new color profile

Test Cases

  • Converting an HDR image from PQ (transfer=16) to HLG (transfer=18) produces a valid output file with transfer characteristic 18 in its color profile @test
  • Converting an image from sRGB (transfer=13) to PQ (transfer=16) correctly updates the profile metadata @test
  • The tool preserves the original image pixel data and dimensions during conversion @test

Dependencies { .dependencies }

pillow-heif { .dependency }

Provides HEIF/AVIF image format support with color profile management capabilities.

Install with Tessl CLI

npx tessl i tessl/pypi-pillow-heif

tile.json