note 83297 modified in function.imagegif by danbrown

From: Date: Tue, 09 Jun 2009 13:16:47 +0000
Subject: note 83297 modified in function.imagegif by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-156599@lists.php.net to get a copy of this message
Simple function for converting a PNG to a GIF. Seems to work for me. <?php function png2gif ( $image_in, $image_out ) { $img = imagecreatefrompng ( $image_in ); $trans_color = imagecolortransparent ( $img ); $trans_index = imagecolorallocate ( $img, $trans_color['red'], $trans_color['green'], $trans_color['blue'] ); imagecolortransparent ( $img, $trans_index ); imagegif ( $img, $image_out ); return True; } ?> --was-- Simple function for converting a PNG to a GIF. Seems to work for me. function png2gif ( $image_in, $image_out ) { $img = imagecreatefrompng ( $image_in ); $trans_color = imagecolortransparent ( $img ); $trans_index = imagecolorallocate ( $img, $trans_color['red'], $trans_color['green'], $trans_color['blue'] ); imagecolortransparent ( $img, $trans_index ); imagegif ( $img, $image_out ); return True; } http://php.net/manual/en/function.imagegif.php

« previous php.notes (#156599) next »