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

Re: scale a gif and background turns black

From: Delfim Machado (
14170@xyz.molar.is)
Date: Tue 28 Jun 2005 - 10:17:44 GMT

  • Next message: Tony Cook: "Re: scale a gif and background turns black"

    the background stays black... :(

    use Imager;

    my @imgs = Imager->read_multi(file=>"./303411.gif");

    my @thumb_imgs;
    push(@thumb_imgs, $_->scale(xpixels=>100, ypixels => 100, type =>
    'min')) for @imgs;

    Imager->write_multi({file=>'test.gif'}, @thumb_imgs);

    This is a bit odd, Imager should manage this issue, right?

    On Jun 28, 2005, at 00:30, Tony Cook wrote:

    > 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
    >
    >
    >

    --
    Delfim Machado
    

    ~ "The point of template engines should be to separate your business logic from your presentation logic, not separate your PHP code from your HTML code." - Brian Lozier

    Attachments: + http://www.molar.is/en/lists/imager-devel/2005-06/c124df3d/01.unnamed.html + http://www.molar.is/en/lists/imager-devel/2005-06/c124df3d/02.PGP.sig



  •