Posible bug - surprisingly huge icon

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
fragath
Posts: 2
Joined: 2017-09-05T05:10:48-07:00
Authentication code: 1151

Posible bug - surprisingly huge icon

Post by fragath » 2017-09-05T08:13:26-07:00

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

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

Re: Posible bug - surprisingly huge icon

Post by snibgo » 2017-09-05T08:59:59-07:00

How many colours do you have in the results from IM and Gimp? If IM gives you more, try the "-colors" option.
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: Posible bug - surprisingly huge icon

Post by glennrp » 2017-09-05T17:08:48-07:00

Not sure but "pngcheck -v file.ico" might help us figure out what's going on.

fragath
Posts: 2
Joined: 2017-09-05T05:10:48-07:00
Authentication code: 1151

Re: Posible bug - surprisingly huge icon

Post by fragath » 2017-09-11T02:57:03-07:00

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

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

Re: Posible bug - surprisingly huge icon

Post by snibgo » 2017-09-11T03:11:03-07:00

Did you try the "-colors" option? Such as "-colors 255" before the output file?
snibgo's IM pages: im.snibgo.com

Post Reply