使用ImageMagick将SVG转换为带抗锯齿的透明PNG [英] Convert SVG to transparent PNG with antialiasing, using ImageMagick

查看:1201
本文介绍了使用ImageMagick将SVG转换为带抗锯齿的透明PNG的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将SVG图像转换为具有透明背景和消除锯齿边缘的PNG文件(使用半透明像素)。不幸的是,我不能让ImageMagick做抗锯齿,边缘总是看起来很糟糕。以下是我的尝试:

I want to convert SVG images to PNG files with transparent background and anti-aliased edges (using semi-transparent pixels). Unfortunately I can't get ImageMagick to do the anti-aliasing, the edges always look terrible. Here's what I tried:

convert +antialias -background transparent  in.svg -resize 25x25 out.png

我可以使用任何想法或不同的命令行工具吗?

Any ideas or a different command line tool I could use?

推荐答案

Inkscape将执行此操作:

Inkscape will do this:

inkscape \
    --export-png=out.png --export-dpi=200 \
    --export-background-opacity=0 --without-gui in.svg

这篇关于使用ImageMagick将SVG转换为带抗锯齿的透明PNG的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆