Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert png to webp does not preserve transparency

Using the Google cwebp utility (https://developers.google.com/speed/webp/docs/cwebp) and the ImageMagick convert utility, I am unable to preserve transparency in png images when converted to webp.

Using convert I've tried using alpha-compression=0 and alpha-quality=100, without positive result. See: https://imagemagick.org/script/webp.php

The images I am working with have transparent corners for a rounded icon image.

Script being used (in Fish shell):

for file in *.png;
  cwebp $file -o (basename $file .png).webp;
end;

and

for file in *.png;
  convert $file (basename $file .png).webp;
end;
like image 459
jeffmcneill Avatar asked Sep 15 '25 21:09

jeffmcneill


1 Answers

Never mind. It was my image editor which was not displaying the transparency properly. Transparency was still there. Now filing a bug report.

like image 117
jeffmcneill Avatar answered Sep 19 '25 14:09

jeffmcneill