red color becomes darker after transform png to webp
See original GitHub issueI’m using sharp to transform images, such as from png to webp format.
some red text in the final webp image, is darker than how it is in the origin png image.
I can’t find any config or arguments to fix this.
following is my code:
sharp( imageAbsolutePath )
.webp({ quality : 100, alphaQuality : 100 })
.toFile( webpAbsolutePath )
.then( function( info ){
info.webpPath = webpAbsolutePath;
return info;
});
This is the origin png image:

and this is the webp version:

Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Image loses color/brightness after converting to webp
1. Convert the image using cwebp · 2. Use nearly any arrangement of arguments · 3. You can noticably see the stars lose...
Read more >WebP image appears darker than JPG - WordPress.org
Hello, I've noticed that the WebP version of this image, https://www.writesofway. ... It seems that is as good as it gets, since the...
Read more >WEBP Images - Dark when saved as JPG or PNG - Reddit
Any time I try either, the resulting saved image looks 2-3 times darker then how it's displayed on the web browser. This happens...
Read more >Webp images to jpg and more: How to convert on Mac - 9to5Mac
This step by step guide with screenshots covers two ways for how to convert webp images to jpg, png, as well as in...
Read more >Change color of PNG image via CSS? - html - Stack Overflow
In the latest version of Chrome, it looks like the (transparent) background is also getting set to the color. In the linked example,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

🎉
I’ve found the solution: normalise the colour profile before converting to WEBP.
Converting PNGs exported by Capture One to WEBP resulted in dark red WEBPs. PNGS exported by Sketch however, resulted in correctly coloured WEBPs. The difference is the colour profiles they use.
I used ImageMagick for converting the colour profile. Below is the ICC file that worked for me:
sRGB_v4_ICC_preference.icc.zip
@lovell Thx.
lossless : truesolves this.