Page 1 of 1

Posible bug - surprisingly huge icon

Posted: 2017-09-05T08:13:26-07:00
by fragath
I have logo in svg format and i tried to generate icon but generated icons (ico format) are surprisingly huge. Below is what i found:

Code: Select all

$ for i in 16 32 64 128 256 ; do mogrify -format ico -density 600 -define icon:auto-resize=$i file.svg ; echo -n "$i " ; ll -h file.ico |  awk '{print $5}'; done
16 1,2K
32 4,2K
64 17K
128 67K
256 33K
To eliminate part with converting svg to png images i did it manually(in gimp): so i got following images and sizes

Code: Select all

16.png	641
32.png	1,3K
64.png	2,6K
128.png	4,6K
256.png	9,1K
i used these files to convert them to icon and i got:

Code: Select all

$ for i in `ls *.png` ; do convert $i $i.ico ; echo -n "$i.ico ";  ll -h $i.ico | awk '{print $5}'; done
16.png.ico 1,2K
32.png.ico 4,2K
64.png.ico 17K
128.png.ico 67K
256.png.ico 9,5K
and again icon with size=128(64 too) is surprisingly huge.

I tried to play with -compress and -quality settings but files are still quite big

Version: ImageMagick 6.8.9-9 Q16 x86_64 2017-07-31 http://www.imagemagick.org

Re: Posible bug - surprisingly huge icon

Posted: 2017-09-05T08:59:59-07:00
by snibgo
How many colours do you have in the results from IM and Gimp? If IM gives you more, try the "-colors" option.

Re: Posible bug - surprisingly huge icon

Posted: 2017-09-05T17:08:48-07:00
by glennrp
Not sure but "pngcheck -v file.ico" might help us figure out what's going on.

Re: Posible bug - surprisingly huge icon

Posted: 2017-09-11T02:57:03-07:00
by fragath
A icon created by this command:

Code: Select all

convert 16.png 32.png 64.png 128.png 256.png out.ico
Contains:
  • 16x16, 32bit BMP
  • 32x32, 32bit BMP
  • 64x64, 32bit BMP
  • 128x128, 32bit BMP
  • 256x256, 32bit PNG
So this is a reason why that files was so big.

The question is it correct behavior of convert to do this conversion and is any way to disable it

Re: Posible bug - surprisingly huge icon

Posted: 2017-09-11T03:11:03-07:00
by snibgo
Did you try the "-colors" option? Such as "-colors 255" before the output file?