我拍了这张照片:
并做到了:
convert -extent 800x600 -background transparent -matte -virtual-pixel transparent -distort Perspective '0,0,369,225 0,255,357,195 255,0,400,218 255,255,400,187' image1.png image2.png
结果(故意使用显示的方格模式来显示透明度):
如何使讨厌的灰色区域变得透明?
我拍了这张照片:
并做到了:
convert -extent 800x600 -background transparent -matte -virtual-pixel transparent -distort Perspective '0,0,369,225 0,255,357,195 255,0,400,218 255,255,400,187' image1.png image2.png
结果(故意使用显示的方格模式来显示透明度):
如何使讨厌的灰色区域变得透明?
添加“-mattecolor 透明”:
convert -extent 800x600 -mattecolor transparent -background transparent -matte -virtual-pixel transparent -distort Perspective '0,0,369,225 0,255,357,195 255,0,400,218 255,255,400,187' test.png test2.png
您的示例图像与您的示例参数,使用 mattecolor:
使用透视图时 mattecolor 选项的文档说明(http://www.imagemagick.org/script/command-line-options.php):
地平线是抗锯齿的,并且可以使用 -mattecolor 设置设置“天空”颜色。