in reply to Re^2: Resizing images with transparent background?
in thread Resizing images with transparent background?

The modified lines should be:

my $image = GD::Image->new($width, $height, $self->gd->truecolor ) +; $image->transparent( $self->gd->transparent() );

Still essentially untested. I haven't found an image with a transparent background kicking around.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP an inspiration; A true Folk's Guy

Replies are listed 'Best First'.
Re^4: Resizing images with transparent background?
by aweizd (Initiate) on Oct 14, 2010 at 13:36 UTC

    It runs with the gd, but transparent() returns "255" for gif and "-1" for png. The result is black background for both. I think I'll just go with ImageMagick and resize to png since that gives me a real alpha channel and not just a single color transparency, as a result i get smooth edges.

    Thanks a lot for your help.

      Thanks a lot for your help

      But in the interests of finding a fix for Image::Resize, could you post one of your images with a transparent background on ImageBin for me to play with?


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

        Well I couldn't upload the file I was playing with since it is a copyrighted logo, but I made you 2 new files (gif and png)

        Have fun!

Re^4: Resizing images with transparent background?
by Anonymous Monk on Oct 14, 2010 at 13:34 UTC

    It runs with the gd, but transparent() returns "255" for gif and "-1" for png. The result is black background for both. I think I'll just go with ImageMagick and resize to png since that gives me a real alpha channel and not just a single color transparency, as a result i get smooth edges.

    Thanks a lot for your help.