Extracting icons with imagemagick creates black stripes on transparency

僤鯓⒐⒋嵵緔 提交于 2019-12-11 09:28:07

问题


For a project of mine I'm fetching websites favicons and storing them to be displayed in a website. Sounds pretty trivial, but I have one strange issue. Almost all icons come in a .ico format, which is not very web friendly. Some icons also have different sizes in them. I'm using Imagemagick to convert them to PNG and extract only the 16x16 icon.

I'm using the following command line for this:

convert source.ico -geometry 16x16 -alpha on -background none -flatten out.png

Unfortunately on some icons this creates some nasty horizontal black stripes in the transparent areas. Here is an example:

This is the original icon:

http://g.etfv.co/http://www.mysqlperformanceblog.com/

This is the result:

http://img585.imageshack.us/img585/1463/65407408.png

Here it is again embedded here:

What could be wrong here? My ImageMagick is version 6.5.4-7


回答1:


Try updating your Imagemagick installation: I tried your command with your .ico file with version 6.6.0-1 and it created the png file correctly

Version: ImageMagick 6.6.0-1 2010-03-03 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC
Features: OpenMP


来源:https://stackoverflow.com/questions/16733545/extracting-icons-with-imagemagick-creates-black-stripes-on-transparency

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