Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Noticeable color shift #2121

Open
hiforrest opened this issue Apr 18, 2024 · 6 comments
Open

Noticeable color shift #2121

hiforrest opened this issue Apr 18, 2024 · 6 comments

Comments

@hiforrest
Copy link

hiforrest commented Apr 18, 2024

The avif image compression resulted in a noticeable color shift, with the cyan area in the top-left area becoming darker. This issue isn't just a one-off; I've tested multiple images, and they all show a clear discrepancy in colors.

Command:
avifenc.exe "SP_2024-04-17_18-42-48.png" "SP_2024-04-17_18-42-48.avif" --min 15 --max 20

Windows 10
libavif v1.0.4

20240418.110417927.mp4

Image files:
avif before after.zip

As a reference, here is a compressed version using convertio.co. This version does not have obvious color deviation.
SP_2024-04-17_18-42-48_1(by web).zip

@vrabaud
Copy link
Collaborator

vrabaud commented Apr 19, 2024

Though I see the color shit in your video, I do not see it in Chrome. Can you please try in your favorite browser to see if the color shift is there too? Thx.

@hiforrest
Copy link
Author

hi @vrabaud, Thank you for paying attention to this issue. I was playing around with the Edge browser and decided to compare how an avif format and its original png version looked across different apps - Edge, Windows Photo Viewer, and Directory Opus. I made a video to show what I found: the colors match perfectly in Edge, but not in the other apps. It's pretty strange.

This makes me wonder why avif images look different depending on the app use. I'm really hoping to get that consistent, true-to-color experience across the board, like what Chrome offers. Got any ideas or fixes? Would love to hear your thoughts!

avif.20240420.001859386.mp4

@tongyuantongyu
Copy link
Contributor

The color shift is due to Windows's decoder using BT709 matrix, despite signaled as BT601 in file. If you add --cicp 1/13/1 the color will match. This is a bug in Windows AVIF decoder.

Note that on some old Windows version, the AVIF decoder also ignores the color range and always use limited range.

The web version is using RGB colorspace so is not affected.

@hiforrest
Copy link
Author

@tongyuantongyu,

Wow, you're an absolute legend! 🙌 You explained the color shift and delivered the solution effortlessly. Thanks a lot for clarifying this tricky color shift issue.

@wantehchang
Copy link
Collaborator

@tongyuantongyu Hi Yuan. Have you reported the bug in the Windows AVIF decoder to Microsoft? If not, I can try to report it.

@tongyuantongyu
Copy link
Contributor

@wantehchang I didn't report myself, but there's a report: https://aka.ms/AAqboe7 that likely refers to this bug. It may help if you are able to report it to the team in Microsoft more directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants