[SOLVED] PNG to ICO while preserving transparency
Posted: 2014-09-16T06:39:36-07:00
Hello,
I'm trying to convert a PNG file to a ICO file (favicon) while keeping the PNG transparency intact. I'm doing this with the sample code provided at http://www.imagemagick.org/Usage/thumbnails/#favicon.
This is my source image, a PNG24 file with transparency: http://www.feitjevandedag.nl/logo.png
This is the code I'm using:
The problem is that the background is always white.
I've tried a lot of parameters like "-alpha set", "-alpha background" and tried it without the "-background none" but the background always remains white, setting "-alpha copy" actually makes the black parts transparent. Looking around the web, people claim removing the "-alpha off" from the sample code mentioned above should do the trick but I haven't gotten it to work yet.
I'm using ImageMagick-6.8.9-7-Q16-x64-dll (for Windows).
Any help is appreciated.
I'm trying to convert a PNG file to a ICO file (favicon) while keeping the PNG transparency intact. I'm doing this with the sample code provided at http://www.imagemagick.org/Usage/thumbnails/#favicon.
This is my source image, a PNG24 file with transparency: http://www.feitjevandedag.nl/logo.png
This is the code I'm using:
Code: Select all
"C:\Program Files\ImageMagick\convert.exe" "C:\Program Files\ImageMagick\logo.png" -bordercolor white -border 0 ^
^( -clone 0 -resize 16x16 ^) ^
^( -clone 0 -resize 32x32 ^) ^
^( -clone 0 -resize 48x48 ^) ^
^( -clone 0 -resize 64x64 ^) ^
-delete 0 -background none favicon.ico
I've tried a lot of parameters like "-alpha set", "-alpha background" and tried it without the "-background none" but the background always remains white, setting "-alpha copy" actually makes the black parts transparent. Looking around the web, people claim removing the "-alpha off" from the sample code mentioned above should do the trick but I haven't gotten it to work yet.
I'm using ImageMagick-6.8.9-7-Q16-x64-dll (for Windows).
Any help is appreciated.