PHP Classes

GIFEncoder

Recommend this page to a friend!

      GIF images into animated GIF with native PHP class  >  All threads  >  GIFEncoder  >  (Un) Subscribe thread alerts  
Subject:GIFEncoder
Summary:Transparent background showing as white
Messages:18
Author:Paul Michali
Date:2007-04-22 16:34:35
Update:2013-05-11 22:10:38
 
  1 - 10   11 - 18  

  11. Re: GIFEncoder   Reply   Report abuse  
Picture of László Zsidi László Zsidi - 2007-09-21 12:37:16 - In reply to message 10 from Shin Zaiaku
Uh...I've found a terrific error:(
Please, ask a shortly time!

  12. Re: GIFEncoder   Reply   Report abuse  
Picture of Shin Zaiaku Shin Zaiaku - 2007-09-26 13:42:33 - In reply to message 11 from László Zsidi
What was the error. The files were updated but they look about the same as the older one. Even the version number went bacc down.

  13. Re: GIFEncoder   Reply   Report abuse  
Picture of Shin Zaiaku Shin Zaiaku - 2007-09-26 13:46:54 - In reply to message 12 from Shin Zaiaku
Tried the new one. Not sure what else is the difference but everything works fine now thanks!

  14. Re: GIFEncoder   Reply   Report abuse  
Picture of EL-IDILBI Bacem EL-IDILBI Bacem - 2007-09-26 15:22:35 - In reply to message 13 from Shin Zaiaku
Thanks a lot !
It works very well now

  15. Re: GIFEncoder   Reply   Report abuse  
Picture of Zachary West Zachary West - 2013-02-07 20:30:18 - In reply to message 14 from EL-IDILBI Bacem
I realize that this thread is old, but I seem to be getting the same issue.


$frames = array();
$framed = array();
$text = array('Hello', 'World');

foreach ($text as $header)
{
for ($i=-10; $i<10; $i++)
{
$im = imagecreatetruecolor(136, 9);
$black = imagecolorallocate($im, 0, 0, 0);
$white = imagecolorallocate($im, 255, 255, 255);

imagecolortransparent($im, $white);
imagefill($im, 0, 0, $white);
imagestring($im, 3, 3, $i, $header, $black);

ob_start();
imagegif($im);
imagedestroy($im);
$frames[] = ob_get_clean();
$framed[] = ($i == -2) ? 1000 : 5;
}
}

$gif = new GIFEncoder($frames, $framed, 0, 2, 0, 0, 0, 'bin');
Header ( 'Content-type:image/gif' );
echo $gif->GetAnimation ( );
//echo $frames[8];

  16. Re: GIFEncoder   Reply   Report abuse  
Picture of Alan Smith Alan Smith - 2013-05-11 22:10:38 - In reply to message 11 from László Zsidi
Yes, a very old thread, but I'm also unable to generate a transparent background. Here's the tail end after I've generated the new images starting with :
imagefill ( $outImage , 0,0 , $backColor );


....


imagecolortransparent($outImage, $backColor);

ob_start();
imagegif($outImage);
$frames[]=ob_get_contents();
$framed[]=10; // refresh time (ms)

// Delay in the animation.
ob_end_clean();

} //frame loop


// Generate the animated gif and output to screen.
$gif = new GIFEncoder($frames,$framed,0,2,0,0,0,'bin');
echo $gif->GetAnimation();

  17. Re: GIFEncoder   Reply   Report abuse  
Picture of dave miller dave miller - 2016-02-23 14:58:59 - In reply to message 16 from Alan Smith
So we never did find out how to do transparent backgrounds....

  18. Re: GIFEncoder   Reply   Report abuse  
Picture of Choqx Marcelo Jose Choqx Marcelo Jose - 2017-01-09 19:41:24 - In reply to message 17 from dave miller
I'm from Peru, my name is marcelo, I'm freelance and I'm very grateful for Mr. László Zsidi

But I have the same problem with the white background.

And intentionally modifying the GIFEncoder.class.php by replacing the value rgb 0xFF by 0x00 and I do not succeed with putting the black background

I do not speak English, I just google translator.

I need to place the black background.
My email marcelouss@hotmail.com

------------------------------------------

soy de peru me llamo marcelo soy freelance y estoy muy agradecido por el seńor László Zsidi

Pero tengo el mismo problema del fondo blanco.

e intenado moficando el GIFEncoder.class.php reeemplazando el valor rgb 0xFF por 0x00 y no logro con poner el fondo negro

no hablo ingles, solo google traductor.

necesito colocar el fondo negro.
mi correo marcelouss@hotmail.com

 
  1 - 10   11 - 18