Webp color issues

A couple of times I’ve had color fidelity issues with the webp image versions in the auto-generated picture markup. Is there a way to get a precise color match but also have the convenience of the generated responsive sizes?

Hi Ed,

Thanks for writing – certainly a precise color match is the goal!

LiveWhale’s image optimization is built using the imagemagick (when available) and GD libraries. Checking with the team, it sounds like there’s some tricky stuff it does working with color profiles that are PHP-version specific which I won’t try to get into here :sweat_smile:. It’s the kind of thing we’ve optimized over time in various releases especially as useful test cases come to surface. If you have an example of “this large image looks bad in these ways when LW resizes it to these dimensions,” feel free to share it and we can take a look at filing it for our roadmap. Thanks!

Karl

Thanks, Karl. Sounds good. Here’s the one I’m working with now. The original jpeg has a black background, and in all of the webp sizes the background is a dark gray.

Jpeg:


Webp

Hi Ed,

Along with whatever the smarter people in this forum might say, I’m wondering if you’ve tried it with a PNG (or even a GIF) as the original image.

Jason

You’re right, Jason. PNG solves the color issue completely. No WebP versions are generated, just the PNG served at different resolutions. It results in larger files, but it’s a good compromise. Thanks!

Awesome! ln general it’s probably the case that JPG isn’t the right compression algorithm for an image like this where consistent color is important.