Danke Posted July 27, 2007 Share Posted July 27, 2007 I'm having a bit of trouble figuring out a step of a script I'm trying to write. I'm trying to make an image overlapping script that makes a full opacity jpg image 50% transparent and overlays it on another image so that they both show. This is how I envision the script: 1. User inputs URLs for image1 and image2 (same size jpgs) into textboxes and hits 'submit'. 2. Script takes image1 and sets the entire image opacity to 50%. 3. Image1 is overlaid over image2 so image2 shows through partly. 4. Script spits out the resulting overlaid image on the next page. I'm having trouble finding a function for step 2 that will change the opacity of image1. I can't change the images into transparent pngs beforehand, since they are coming off the Internet and are already saved as jpgs. I've looked through the GD Library functions, but I can't seem to find something that will do the trick--does anyone have any suggestions? Link to comment https://forums.phpfreaks.com/topic/62098-changing-an-images-opacity/ Share on other sites More sharing options...
envexlabs Posted July 27, 2007 Share Posted July 27, 2007 Just set a CSS class for image1. I'm not to sure the code, but google should find it no problem. Opacity Link to comment https://forums.phpfreaks.com/topic/62098-changing-an-images-opacity/#findComment-309172 Share on other sites More sharing options...
marcus Posted July 27, 2007 Share Posted July 27, 2007 http://www.cgi-interactive-uk.com/php_gd2_imagecopymerge.html Link to comment https://forums.phpfreaks.com/topic/62098-changing-an-images-opacity/#findComment-309183 Share on other sites More sharing options...
Danke Posted July 27, 2007 Author Share Posted July 27, 2007 Oh, thank you, mgallforever! I had seen that function, but I thought it only affected pictures that already had transparency for some reason. Let me see how it works. Envexlabs, thanks so much for the tip--that's a really easy and simple way to do it, come to think of it. But I need to be able to save the combined image so I don't think that method would work for me. Link to comment https://forums.phpfreaks.com/topic/62098-changing-an-images-opacity/#findComment-309187 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.