• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
image library - gd2 - png/gif resizing with transparency

woopsicle i am guessing that you are working with a gif image. to maintain transparency in creating a new gif on the fly (which is pretty much what you do when resizing) you need to first allocate a background colour for the new image, then set that colour to be the transparent colour.

the order in which these functions are called is as follows:
imagecreatetruecolor // create new truecolor image
imagecolorallocate // allocate color to background
imagecolortransparent // nominate background color as transparent
imagecopyresampled  create a copy by resample
imagegif // generate gif from stuff you have just created

the arguments to these various functions you can find in the php manual.
to me it does not look like the Image_lib has been set up to work with gif transparency.
maybe i might have a shot at providing support for gif and png transparency in this library when i get a break in traffic. ;-)
unless, of course, some wonderful person has already contributed this work.

Messages In This Thread
image library - gd2 - png/gif resizing with transparency - by El Forum - 07-18-2007, 10:35 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.