(none) imager-devel
/ help / lists / applications / search /
 

Re: scale a gif and background turns black

From: Tony Cook (
14094@xyz.molar.is)
Date: Mon 27 Jun 2005 - 23:30:23 GMT

  • Next message: Delfim Machado: "Re: scale a gif and background turns black"

    On Mon, Jun 27, 2005 at 02:07:53PM +0100, Delfim Machado wrote:
    > -----BEGIN PGP SIGNED MESSAGE-----
    > Hash: SHA1
    >
    > Hi Tony, this is my code
    >
    > use strict;
    > use Imager;
    >
    > my $img = Imager->new;
    >
    > $img->read(file=>"./303411.gif");
    >
    > my $thumb = $img->scale(xpixels=>100, ypixels => 100, type => 'min');
    >
    > $thumb->write(file=>'test.gif', transp=>'threshold');

    Ok, I was looking at the wrong side for this problem.

    You want:

      my ($img) = Imager->read_multi(file=>...);

    The loss of transparency with the single image read is historical,
    from before we had read_multi() and should change.

    The current GIF reader tries to build a "screen" based on the
    background color set in the image (usually black) and place each image
    on that background.

    Tony



  •