Banner
Views: 236,100,553
Time: 2013-05-20 10:46:59 PM
15 users online: aj6666, Amos Defamos, o AnybodyAgrees, cyphermur9t, o Devann, Epsilon, Hailcrash, o iRhyiku, JCE3000GT, mario90, PercentN, RaindropDry, Ramidalv, SilverDeoxys563, supernova38 - Guests: 20 - Bots: 14Users: 22,854 (1,291 active)
Latest: KennySouthPark
Tip: Ask the author for permission before ripping graphics from their hack.
Transparent Image Overlays in PHP
Forum Index - Hobbies - Computers & Technology - Transparent Image Overlays in PHP
Pages: « 1 »
Hello. I've been working on a few things recently. One thing that has caused me a slight bit of grief is that with php, when I resize an image with transparency to overlay on another image (such as a meme macro or something) I lose the transparency and it turns to black. Therefore, the original image is lost and I have a simple resized overlay with transparency turned into blackness. How do I resize a transparent image in php and keep the transparency? By the way, it's an alpha png.
What a google search for "resize png keep transparency php" gave me

Basically, if you set
Code
imagealphablending( $targetImage, false ); imagesavealpha( $targetImage, true );

It should work.
The image was fixed, but of note, alphablending should have been ON.
Last edited on 2011-10-09 01:20:56 PM by Vector.
Pages: « 1 »
Forum Index - Hobbies - Computers & Technology - Transparent Image Overlays in PHP

The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.

Copyright © 2005 - 2013 - SMW Central
Legal Information - Link To Us


Total queries: 29

Menu