使用 Googlecwebp实用程序 ( https://developers.google.com/speed/webp/docs/cwebp ) 和 ImageMagickconvert实用程序,我无法在转换为 webp 时保留 png 图像的透明度。
使用convert我尝试使用 alpha-compression=0 和 alpha-quality=100,但没有积极的结果。请参阅: https: //imagemagick.org/script/webp.php
我正在处理的图像具有透明的角,用于圆形图标图像。
正在使用的脚本(在 Fish shell 中):
for file in *.png;
cwebp $file -o (basename $file .png).webp;
end;
Run Code Online (Sandbox Code Playgroud)
和
for file in *.png;
convert $file (basename $file .png).webp;
end;
Run Code Online (Sandbox Code Playgroud)