Skip to content

Brightness (colors) of AVIF file depends on viewer application #40

@darkcharmander

Description

@darkcharmander

There is something strange going on here! I don't know whether the problem lies in cavif, but maybe someone can shed some light on this:

The problem is that the brightness of the AVIF files seem to change depending on what viewer you use for them.
I will sketch out the scenario that I have. I have converted a sample image via https://convertio.co (We'll call it 'internet' in the scenarios as source) as test image to compare against cavif. This is what happens:

Viewer: Firefox

Original: Normal
Cavif: Too bright
Internet: Normal

Viewer: nomacs or xnviewmp

Original: Normal
Cavif: Normal
Internet: Too bright

I think that in either the AVIF container something is wrong, or in the decoder that is used. Before I convert a ton of images to AVIF, I would like to know what is causing this. I don't want to convert everything and then discover that the colors are messed up in some places. If it's a decoder issue, then which decoder is wrong here? Firefox or nomacs? Given that the internet file and cavif file both look different depending on the application that is used.

For your convenience, I attached the demo images to this post. They are royalty free and taken from https://www.pexels.com/nl-nl/foto/dier-schattig-boerderij-gras-4321311/, so yes, this is perfectly legal. (I had to zip them because GitHub doesn't 'support' AVIF files.)
Demo files: cavif-image-brightness-sample.zip

I've used a couple of different commands to convert the image to AVIF with Cavif, but they all yield the same result. Here is one of the commands that I've used: cavif --rate-control q --crf 10 --row-mt --tile-rows 2 --tile-columns 2 --color-primaries bt2020 --transfer-characteristics bt2020 --enable-full-color-range -i original.png -o out.avif

If you do not enable BT.2020, it seems you can lose colors sometimes. I therefore always enable it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions