2
我尝试将SVG转换为PNG。结果图片有白色背景我需要透明。SVG到PNG由PythonMagickWand
示例代码:
wand = NewMagickWand()
MagickReadImage(wand,tmp_file_name)
transparentColor = NewPixelWand()
PixelSetMagickColor(transparentColor, 'none')
MagickSetBackgroundColor(wand, transparentColor)
MagickWriteImage(wand,new_filename)
,如果我在命令行做:
convert -background 'transparent' ./media/2222222.svg ./media/2222222.png
我有一个透明的图片。
你尝试'PixelSetMagickColor(transparentColor, '白')'什么? – nmichaels 2010-11-10 21:25:26
我做了同样的结果,背景是白色的。 – mapcuk 2010-11-10 22:54:53