Convert PNG to ICO

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
activat
Posts: 4
Joined: 2019-05-14T15:53:57-07:00
Authentication code: 1152

Convert PNG to ICO

Post by activat »

Hallo, i convert PNG to ICO with next command:

Code: Select all

magick -density 128x128 -background none in.png -resize 128x128 out.ico
as result i have ico file with artefact's. Please help me with correct command.
I use windows.
Example file:Image
Last edited by activat on 2019-05-14T17:29:47-07:00, edited 1 time in total.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert PNG to ICO

Post by fmw42 »

Please always provide your Imagemagick version and platform/OS when asking questions. Also post your input PNG so we can test with it.

Note that your command should properly read the input first. IM 7 is less forgiving that IM 6.

Code: Select all

magick in.png -background none -resize 128x128 -density 128x128 out.ico
activat
Posts: 4
Joined: 2019-05-14T15:53:57-07:00
Authentication code: 1152

Re: Convert PNG to ICO

Post by activat »

Hallo, thank you for help. My IM version is:

Code: Select all

ImageMagick-7.0.8-44-Q16-x64-dll.exe
And i use IM on windows.
Example image in my first post.
I run command you provide and still see artefact's.

Code: Select all

magick red-apple_1f34e.png -background none -resize 128x128 -density 128x128 red-apple_1f34e.ico
Image
That you suggest - its possible to do something?
Thank you again.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert PNG to ICO

Post by fmw42 »

This command works fine for me on IM 7.0.8.44 Q16 HDRI Mac OSX Sierra. Sorry, I do not use Windows.

Code: Select all

magick in.png -background none -resize 128x128 -density 128x128 out.ico
Do you get those artifacts for all PNG files or just that one?

Have you tried upgrading to IM 7.0.8.45?

Is your version of libpng current? Use

Code: Select all

convert -list format
and look at the end of the line for PNG to see the version. Mine is libpng 1.6.36
activat
Posts: 4
Joined: 2019-05-14T15:53:57-07:00
Authentication code: 1152

Re: Convert PNG to ICO

Post by activat »

Hallo, i upgrade to latest IM and my libpng is 1.6.37
I have same problem on all my PNG set.
But i find that make problem. It's resize command.
My PNG's is 144x144 size and without resize, just convert - everything perfect.
For me size not important so problem solve itself.
Thanks for help.
Image
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Convert PNG to ICO

Post by snibgo »

@activat: when you report problems, please link to the actual input and output files, eg out.ico. Supplying a link to a screenshot make by a program such as IrfanView isn't enough, because there might be a bug in IrfanView.
snibgo's IM pages: im.snibgo.com
activat
Posts: 4
Joined: 2019-05-14T15:53:57-07:00
Authentication code: 1152

Re: Convert PNG to ICO

Post by activat »

You completely right! After check out.ico in another's viewers i found that problem only in my IrfanView .
Thanks for point me on this. Maybe next time i be more smart.
ps: i take files from this page: https://emojipedia.org/facebook/
in.png Image
out.ico Image
Many thanks for help!
Post Reply