FileConverter icon indicating copy to clipboard operation
FileConverter copied to clipboard

PNG to WEBP Dulls the Red Channel

Open locuturus opened this issue 2 years ago • 2 comments

Hello, converting PNGs such as screenshots made by my Android phone, to webp results in a loss of red color. See attached for an example. I was looking around the web and it seems one idea is a colorspace mismatch.

The original: Screenshot_20240113-183727

A screengrab of the webp (Github won't upload it as a webp): image

Some very light googling I have already done: https://github.com/lovell/sharp/issues/1000 https://lightrun.com/answers/lovell-sharp-red-color-becomes-darker-after-transform-png-to-webp

locuturus avatar Jan 20 '24 22:01 locuturus

I have this same issue, but I'm using govips. The vips CLI works fine and keeps the red color as it should be, however when converting a PNG to WebP with Govips I run into this issue.

Auxority avatar Mar 04 '24 08:03 Auxority

Update: Figured out my case had to do with the missing color profile. Govips doesn't export the color profile when exporting to WebP. So my original image had a P3 Display color profile, but this was missing from the metadata in the output image. There's already a pull request for it, but the tests failed so it was rejected.

@locuturus

Auxority avatar Mar 05 '24 12:03 Auxority