Export .svg to .png without (any) antialiasing (`+antialias` doesn't work)

六月ゝ 毕业季﹏ 提交于 2019-12-10 22:16:32

问题


I'm trying to export a svg file to an icon sized .png. The problem is that I can't seem to be able to force ImageMagick to not to use antialiasing.

It seems to me that +antialias only turns off between colors aliasing but doesn't prevent to-alpha-channel aliasing.

I've tried:

  • convert +antialias -background none plug.svg -resize 32x32 plug.png
  • convert +antialias -background none -size 32x32 plug.svg -resize 32x32 plug.png
  • Putting the +antialias keyword anywhere in the clause...

And all of them produce:


Imagemagics version: Version: ImageMagick 6.7.7-10 2017-02-22


回答1:


If you want to force ImageMagick to use 1-bit alpha channel, try using PNG-8 and set a better filtering algorithm such as Lanczos:

-filter Lanczos -resize 64x png8:result64px.png

This is an enlarged result with a 1-bit alpha channel:



来源:https://stackoverflow.com/questions/42491754/export-svg-to-png-without-any-antialiasing-antialias-doesnt-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!