note 112842 added to function.imagecolorallocate

From: Date: Mon, 29 Jul 2013 14:31:32 +0000
Subject: note 112842 added to function.imagecolorallocate
Groups: php.notes 
Request: Send a blank email to php-notes+get-195806@lists.php.net to get a copy of this message
To expand on Ludo's solution to the limitation of GIF and 8-bit PNG files. By default, his method will convert a GIF to an 8-bit PNG which still has the same problem. It is recommended you copy the image to a truecolorimage such as : $src = imagecreatefromstring('my_image.gif'); $width = imagesx($src); $height = imagesy($src); $handle = imagecreatetruecolor($width,$height); imagecopyresized($handle,$src,0,0,0,0,$width,$height,$width,$height); And now you can work on $handle as normal, and use imagecolorallocate without fear. ---- Server IP: 69.147.83.199 Probable Submitter: 68.40.48.192 ---- Manual Page -- http://php.net/manual/en/function.imagecolorallocate.php Edit -- https://master.php.net/note/edit/112842 Del: integrated -- https://master.php.net/note/delete/112842/integrated Del: useless -- https://master.php.net/note/delete/112842/useless Del: bad code -- https://master.php.net/note/delete/112842/bad+code Del: spam -- https://master.php.net/note/delete/112842/spam Del: non-english -- https://master.php.net/note/delete/112842/non-english Del: in docs -- https://master.php.net/note/delete/112842/in+docs Del: other reasons-- https://master.php.net/note/delete/112842 Reject -- https://master.php.net/note/reject/112842 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#195806) next »