Hi all,

I am currently making a website that has e-custom functions and a back end for the client.

I want them to be able to upload images - but they need to be transparent. I do not want to leave this in the hands of the client, so I am looking at ways of using the GD library to make the change

I got no issue with the png/gif type for upload/resize function since this type already transparent background but my major problems is how to deal with jpeg/jpg image type which is their background was not a transparent...so is it possible I can change/ convert to png/gif type upon successful of uploading image...so the new final image will be png/gif type with transparent background...is it doable...I am not even sure it is possible...?

Thanks for any help..

    I do try with this tiny script and it's do the trick the only thing is the image is still having background colour so how can I remove the background colour and make it as transparent background

    here's the code

    
    //source jpeg image with white background colour it can be any colour as I assume 
     $image = ImageCreateFromJPEG("bunnyjpeg_nottransparent.jpg");
    
    
      header("Content-Type: image/png");
    
      ImageJpeg($image, "mynewbunnypic.png");
    
      ImageDestroy($image);
    
    

    hope someone will give me some shed on light on this...

    Thanks in advanced

      Write a Reply...