Converting ICO file to PNG using PHP
I’ve been looking for a while for a way to convert ICO files to PNG to easily display them on the web page.
There is a nice class in PHPClasses site written by Joshua Hatfield that does just that.
Haven’t tried it myself, but the code looks promising enough, and the sample works pretty good.
See the class in action here: http://www.phpclasses.org/browse/package/3906.html
3 Comments to “Converting ICO file to PNG using PHP”
Leave a Reply


Thanks for the kudos. Congrats on the new WordPress installation. I would add that if you’re simply looking to convert an icon to PNG, you could just use my sample on my website as it displays them as PNGs. That’s at http://blog.flobi.com/test/floIcon/ . The php class actually converts the icon to a GD resource for PHP, but there’s a convenient imagepng() function that will save them in PNG format (also imagejpeg() and imagegif(), but they don’t support alpha transparency, and no transparency for jpeg).
I have been looking looking around for this kind of information. Will you post some more in future? I’ll be grateful if you will.
@GarykPatton: Yea, Will try.
I’m building an application that will store my entire icons collection in a database that will be sortable and easily searched.
If I have more on the info (like creating ICO files from PNG formats) will post