How do I extract only the 16x16px size from a Windows ICO using Imagemagick?

125 Views Asked by At

This is the string I'm using now:

magick convert -set filename:f "%t_%wpx" "ICO:myicon.ico[0]" %[filename:f].png

This operation does work some of the time, but there are several icons of which the 16px variant is not [0]. Some icons I converted gave me the 48x48 size for instance (and they did have the 16x16px present).

Is there an ImageMagick statement I can use that will always save out the 16px size (provided it exists)?

0

There are 0 best solutions below