Converting from 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?".
Locked
skoll
Posts: 2
Joined: 2013-03-11T06:23:17-07:00
Authentication code: 6789

Converting from ico

Post by skoll »

Hi,

I need to convert a multi-resolution ico to a png. When I invoke the command

Code: Select all

convert image.ico image.png
I get several output files, one for each resolution in the ico.

When I invoke the command

Code: Select all

convert image.ico -thumbnail 64x64 -flatten image.png
I do get one file as output, but it seems to use the first resolution in the ico as input, which is the smallest one. With the files I'm using, it generates the 64x64 output based on 16x16 input.

How can I generate one png file, that's based on the 64x64 resolution bitmap that I know to exist inside the ico?

Thanks in advance.

snibgo
Posts: 13034
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Converting from ico

Post by snibgo »

I haven't any samples to test this, but you can probably use the [n] notation. eg ...

Code: Select all

convert image.ico[4] -thumbnail 64x64 -flatten image.png
... where "4" is whichever number for the one you want. If you don't know which number that is, you can probably find it from "identify -verbose".
snibgo's IM pages: im.snibgo.com

User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: Converting from ico

Post by glennrp »

snibgo wrote:I haven't any samples to test this, but you can probably use the [n] notation. eg ...

Code: Select all

convert image.ico[4] -thumbnail 64x64 -flatten image.png
... where "4" is whichever number for the one you want. If you don't know which number that is, you can probably find it from "identify -verbose".
Simply "identify file.ico" should work (without the "-verbose"). It'll list the dimensions for each "[n]".

skoll
Posts: 2
Joined: 2013-03-11T06:23:17-07:00
Authentication code: 6789

Re: Converting from ico

Post by skoll »

Thanks a lot! That's exactly what I was looking for.

Locked