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

PNG with embedded color profile not displayed correctly #103

Open
dvicini opened this issue Jun 1, 2020 · 3 comments
Open

PNG with embedded color profile not displayed correctly #103

dvicini opened this issue Jun 1, 2020 · 3 comments

Comments

@dvicini
Copy link
Contributor

dvicini commented Jun 1, 2020

Hi,

I was trying to load a PNG image in TEV which was exported from GIMP. I did not create the image myself, but the person who created the image essentially loaded an EXR image in GIMP and exported it as a PNG with minor changes. The PNG displays correctly in Adobe Photoshop and Preview on MacOS, but not in TEV.

Upon closer inspection, I found that the PNG was stored in 16 bit with a custom color profile from GIMP. Reducing to 8 bit, but keeping the profile, does not change anything about the way TEV displays the image. If I convert the profile to a more standard RGB profile in Photoshop, TEV displays the image correctly.

So it seems that the problem is that TEV ignores custom color profiles in PNG files (?). I am not sure how easy it is to change that, but it would be good to at least have a warning being shown.

I have attached both an 8 bit and the original 16 bit version of the file.

test_images.zip

Best,
Delio

@Tom94
Copy link
Owner

Tom94 commented Jun 1, 2020

Hi Delio, thanks for sharing + allowing for reproduction! This is a good issue to keep track of.

PNG decoding is unfortunately completely out of the hands of tev. tev uses stbi to open LDR images, including PNGs, and stbi doesn't support querying color profile information. See this issue on their end.

I'm hesitant to pull in heavier cannons than stbi to decode LDR images more correctly, since the primary purpose of tev remains operating on HDR data.

@dvicini
Copy link
Contributor Author

dvicini commented Jun 1, 2020

Hi Thomas,

I knew that TEV was using an external library to load PNGs, but I wasn't aware that they don't even support color profiles! Let's hope someone replies to your comment on the other issue, such that we can at least have some kind of warning :)

Thanks for looking into it
Delio

@Tom94 Tom94 mentioned this issue Dec 14, 2021
@satoshiSchubert
Copy link

Thank you so much for mentioning this problem and the tips on how to fix it with photoshop! After I used photoshop to open the problematic png file, photoshop prompted that there was a problem with the color profile. After conversion, it can be displayed normally in Tev after saving.

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

3 participants