Page 1 of 1

Converting to large ICO format

Posted: 2014-01-05T06:25:09-07:00
by Mahroun
I'm trying to convert to ICO format with many sizes including large ones.
I'm able to view the output image in image viewers but my app can't access the ones larger than 256, opening the same output image in Axialis IconWorkshop and saving it (without modification) will make it work.
I'm I missing something in the command line?

Code: Select all

convert.exe "c:\output_image.jpg"
	-gravity center
	( -clone 0 -resize 120x120 ( +clone -background black -shadow 80x2+0+0 ) +swap -background transparent -layers merge -extent 128x128 )
	( -clone 0 -resize 248x248 ( +clone -background black -shadow 80x2+0+0 ) +swap -background transparent -layers merge -extent 256x256 )
	( -clone 0 -resize 376x376 ( +clone -background black -shadow 80x2+0+0 ) +swap -background transparent -layers merge -extent 384x384 )
	( -clone 0 -resize 504x504 ( +clone -background black -shadow 80x2+0+0 ) +swap -background transparent -layers merge -extent 512x512 )
	-delete 0 -alpha on -type TrueColorMatte -compress Zip
	"c:\output_image.ico"
Help appreciated.

Re: Converting to large ICO format

Posted: 2014-01-05T06:36:16-07:00
by glennrp
coders/icon.c has this in the encoding section

Code: Select all

    if ((image->columns > 256L) || (image->rows > 256L))
      ThrowWriterException(ImageError,"WidthOrHeightExceedsLimit");
The icon format limits the dimensions to a maximum of 256x256.

Re: Converting to large ICO format

Posted: 2014-01-05T06:41:00-07:00
by Mahroun
Are you saying I can't include larger than 256 images in an ICO file?
So why does it work just by opening the image and saving it in Axialis IconWorkshop without any modification?

Re: Converting to large ICO format

Posted: 2014-01-05T07:01:16-07:00
by glennrp
Mahroun wrote:Are you saying I can't include larger than 256 images in an ICO file?
You cannot include them if you use ImageMagick to write your ICO files.
So why does it work just by opening the image and saving it in Axialis IconWorkshop without any modification?
It works because the ICO format is not well specified, and some applications allow larger images than 256x256. ImageMagick
tries to write ICO files that can be read by most if not all applications.
See http://en.wikipedia.org/wiki/ICO_%28file_format%29
Note that the width and height are one-byte fields and thus are limited to 256x256 (zero being defined to mean 256).
I can't find an actual spec. The wiki doesn't say what is supposed to happen if the PNG dimensions aren't
the same as the ICO header dimensions. It would be interesting to see what Axialis puts in the ICO header
when width or height exceeds 256.

Re: Converting to large ICO format

Posted: 2014-01-05T07:12:59-07:00
by Bonzo
Axialis IconWorkshop icons may not be "traditional icons", they just call them that.
Android, iPhone OS and Windows Phone operating systems define new standards for icons. IconWorkshop lets you create in minutes icons following the specifications of those operating systems.
There are new specifications coming out for things everyday but a lot of them do not last. Do you want the IM developers to drop everything else and change the code for something that may not last?

Re: Converting to large ICO format

Posted: 2014-01-05T07:17:13-07:00
by Mahroun
I didn't know about the limitations, and Its kinda let down, I wrote a movie library app and wanted to include many sizes in one file to quickly switch view size.
But now I think its better to thumbnail large none-ico images.

Thanks for the help guys :)