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

Hm. It seems that GD's handling of pngs with transparency is broken, If you just load the png and then write it back to a new file, the transparency is screwed. Replaced by black. Doing the same with the gif version worked okay.

Whether the fault lies in GD; or the underlying libgd; or the libraries that underlie that is questionable. But given that libgd seemed to have died a death, I guess it's time to move on and find something else that provides similar functionality without requiring your conversion to O'Woe in order to use it.


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
  • Comment on Re^7: Resizing images with transparent background?

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

    The difference is that PNG uses an alpha channel for transparencies while GIF just sets a certain (and single) color to be transparent. GD just seems to ignore the alpha channel in a PNG file so when a pixel is (0,0,0,0), it just reads the first 3 value which result in a black pixel.

    Do you know another module for manipulating images? Besides ImageMagick that is.

      GD has always served my needs till now; but the recent news of libgd stagnation made me make a mental note to look at other options. I tried I::M once and found it to be a huge messy things; 'sides I couldn't possibly bring myself to use anything that spelt magic with a 'k' :)

      I just found Imager available as a PPM for 64-bit, so, I installed that. I obviously can't yet comment upon it's abilities. Seems quite large at 142 files. But, at a cursory glance, it also seems to be very well structured and documented, and that is half the battle.


      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.