note 67944 deleted from function.imagecolortransparent by cmb
| From: | cmb@php.net | Date: | Sun, 01 Dec 2019 08:49:55 +0000 |
| Subject: | note 67944 deleted from function.imagecolortransparent by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-213324@lists.php.net to get a copy of this message | ||
Note Submitter: Blaine Ehrhart
----
This script creates transparency for a specific RBG color for an already created GIF image.
<?php
$im = imagecreatefromgif('trans.gif');
$img = imagecreatetruecolor(16,16);
$trans = imagecolorallocate($img,255,99,140);
imagecolortransparent($img,$trans);
imagecopy($img,$im,0,0,0,0,16,16);
imagetruecolortopalette($img, true, 256);
imageinterlace($img);
imagegif($img,'trans.gif');
imagedestroy($img);
?>