Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert png file to ico with PHP

Tags:

php

icons

png

gd

I would like to create a PHP script that convert a png file to an ico file. Is it possible to do it just with PHP ? How ?

Thanks !!!

like image 400
Jensen Avatar asked Apr 13 '10 08:04

Jensen


People also ask

Can I rename PNG to ICO?

Take any PNG file and rename it with a . ico extension. Really, that's all it is. See also The evolution of the ICO file format, part 4: PNG images.

Is ICO same as PNG?

No. An ICO is actually a specialized file format that contains a collection of images at potentially many different sizes and color depths. A png is a specific image.


1 Answers

This seems to suggest Imagick can do this.

Otherwise, you could do the conversion on the server using an external tool and server the .ico file. Tools to achieve this have been analyzed in Stack Overflow before (well, doing the opposite transformation, but I bet most of that software can do what you need).

like image 170
Roberto Aloi Avatar answered Oct 27 '22 01:10

Roberto Aloi