我有PNG文件,我想将整个图像转换为半透明.该图像将在KML文件中作为图标叠加层引用,以便在Google地球/地图中使用.
我使用ImageMagick convert命令向我建议了以下示例,但似乎都不起作用.第一个示例导致错误,第二个示例无法对图像进行任何可观察的更改.
$ /usr/local/bin/convert 121112142121.png -channel Alpha -evaluate Set 50% 2121112142121.png
convert: no decode delegate for this image format '121112142121.png' @ error/constitute.c/ReadImage/550.
convert: option requires an argument '-evaluate' @ error/convert.c/ConvertImageCommand/1400.
Run Code Online (Sandbox Code Playgroud)
第二个建议的方法是这样的:
convert filename.png -fill '#00000080' -draw 'matte 100,100 reset' output.png
Run Code Online (Sandbox Code Playgroud)
虽然我可以在网上找到许多用于从特定颜色或alpha蒙版创建完全透明图像的示例,但我似乎找不到任何可用于创建半透明图像的工作.我想用convert命令或ImageMagick Perl找到一种方法.
ImageMagick版本是6.8.0-4.