wert790 Posted October 14, 2010 Share Posted October 14, 2010 Hi!I'd like to have a transparent product image background instead of the ordinary white one. I understand i have to make changes to images.inc.php file, but i just can't get it to work.Do anyone know where i can get a finished, working image.inc.php file which creates png-files with transparent background?Thanks alot! Link to comment Share on other sites More sharing options...
Steppo Posted October 14, 2010 Share Posted October 14, 2010 Hi!I been trying this also but instead i put in the same color as the background witch is perfect for me - in rgb color (use photoshop to convert your values). Although this won´t help you if you have an image as the shop´s background but anyway - for this i have no solution. Here are the changes i did made (the 70 numbers) on line 157 in latest stable PS version:$white = imagecolorallocate($destImage, 70, 70, 70); //Stefan Link to comment Share on other sites More sharing options...
wert790 Posted October 15, 2010 Author Share Posted October 15, 2010 Hi!Unfortunatly i have a gradient picture as a background and hence cannot use your method. Thanks for the answer anyway !Anyone else with a suggestion? Link to comment Share on other sites More sharing options...
MrBaseball34 Posted October 15, 2010 Share Posted October 15, 2010 Use the PHP function imagecolortransparent() to set the color you want to be transparent.Remember, you cannot set JPGs as transparent so you need to save as PNG or GIF and modify all your images to that type. Link to comment Share on other sites More sharing options...
Steppo Posted October 16, 2010 Share Posted October 16, 2010 Intresting! Is it really not possible with jpg?Stefan Link to comment Share on other sites More sharing options...
rocky Posted October 16, 2010 Share Posted October 16, 2010 Nope, JPEGs don't support transparency. GIFs support transparency and PNGs support semitransparency. Link to comment Share on other sites More sharing options...
MrBaseball34 Posted October 17, 2010 Share Posted October 17, 2010 PNGs support semitransparency. PNG's support full and alpha transparency with alpha channels. Link to comment Share on other sites More sharing options...
wert790 Posted October 18, 2010 Author Share Posted October 18, 2010 Problem solved, thanks for your feedback. I used a ready-made images.inc.php found in this thread: http://www.prestashop.com/forums/viewthread/23714/P15/third_party_modules/images_dot_inc_dot_php__made_to_use_png ( the one posted by goums, creds to him ). Link to comment Share on other sites More sharing options...
Laelenie Posted June 27, 2011 Share Posted June 27, 2011 anaway , if someone does not want to change code or is not confident with his php skills there is a module in the prestashop ADDONS section that solves the issue automatically:http://addons.prestashop.com/en/front-office-features/2844-transparent-png-support.html Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now