我有一些PNG文件,希望将整个图像转换为半透明。
该图像将被引用为KML文件中的图标覆盖层,以在Google Earth / Maps中使用。
以下是使用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.
第二个未能对图像进行任何可观察的改变:
convert filename.png -fill '#00000080' -draw 'matte 100,100 reset' output.png
虽然我可以在网上找到很多例子来创建特定颜色或alpha蒙版的完全透明图像,但我似乎找不到任何可用于创建半透明图像或更改不透明度的示例。我希望能够找到一种使用convert命令或ImageMagick Perl实现这个目标的方法。
(ImageMagick版本为6.8.0-4)