Skip to content

HEIF/AVIF color space error #365

@XPRAMT

Description

@XPRAMT

Describe the bug

When saving images as HEIF/AVIF using pillow_heif, color shifts occur because pillow_heif uses incorrect color tagging.

Error color:
Image

Correct Color:
Image

Steps/Code to Reproduce

if fmt == "HEIF" or fmt == "AVIF":
img.save(save_path, format=fmt, quality=quality)

Expected Results

Color primaries : | BT.709
Transfer characteristics : | BT.709
Matrix coefficients : | BT.709

Image

Actual Results

Color primaries : | BT.709
Transfer characteristics : | sRGB/sYCC
Matrix coefficients : | BT.601
Image

Versions

3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
Windows-10-10.0.26120-SP0
1.0.0
{'libheif': '1.19.8', 'HEIF': 'x265 HEVC encoder (4.1+1-1d117be)', 'AVIF': '', 'encoders': {'x265': 'x265 HEVC encoder (4.1+1-1d117be)', 'mask': 'mask'}, 'decoders': {'libde265': 'libde265 HEVC decoder, version 1.0.16'}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions