phpknight Posted August 20, 2007 Share Posted August 20, 2007 I've been searching the posts and still cannot figure out how to do this. Here is the issue: 1.) If I upload a PNG and resize it, any transparent background turns black. Many people have spotted this. 2.) Is there a way to reatain transparency AND keep black as black if the image originally has it? From seraching, it appears it has something to do with imageSaveAlpha and imageColorTransparent, but I still I am not if these would fix the issue. Quote Link to comment https://forums.phpfreaks.com/topic/65801-png-transparency-while-retaining-black/ Share on other sites More sharing options...
php_tom Posted August 20, 2007 Share Posted August 20, 2007 Not sure if this is your problem, but if you're viewing the image in IE6, it doesn't support PNG transparency. See this site for a fix in JavaScript: http://homepage.ntlworld.com/bobosola. Otherwise, make sure that the "save gamma" option is checked when you save your image. Quote Link to comment https://forums.phpfreaks.com/topic/65801-png-transparency-while-retaining-black/#findComment-328789 Share on other sites More sharing options...
MadTechie Posted August 20, 2007 Share Posted August 20, 2007 before you resize (imagecopyresized) use imagealphablending($imageFile, true); Quote Link to comment https://forums.phpfreaks.com/topic/65801-png-transparency-while-retaining-black/#findComment-328802 Share on other sites More sharing options...
phpknight Posted August 20, 2007 Author Share Posted August 20, 2007 It's IE 7. So, if somebody uploaded a transparent PNG and did not save the gamma, is it going to turn black anyway in IE even though it would not in Photoshop? Please explain. MadTechnie, that alphablending will work and retain the black native to the image as well? Quote Link to comment https://forums.phpfreaks.com/topic/65801-png-transparency-while-retaining-black/#findComment-328849 Share on other sites More sharing options...
MadTechie Posted August 20, 2007 Share Posted August 20, 2007 as for IE PNG, read this Quote Link to comment https://forums.phpfreaks.com/topic/65801-png-transparency-while-retaining-black/#findComment-328856 Share on other sites More sharing options...
phpknight Posted August 20, 2007 Author Share Posted August 20, 2007 Okay, I will be sure to let you know if this works when I get to that part. I am not too worried about that problem for IE6. I no longer program for old browsers, lol. Quote Link to comment https://forums.phpfreaks.com/topic/65801-png-transparency-while-retaining-black/#findComment-328864 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.