eternalc Posted May 30, 2012 Share Posted May 30, 2012 Hi all, Does anyone else have this issue? When using the automatic resizing (thumbnail generation) function from admin, the image quality of the resultant thumbnails is very poor. Our source files are very clean, high res and high quality, and we've tried bumping the jpeg compression up to 100% in the admin panel. We've tried uncompressed png > jpg and high quality jpg > jpg. But the image quality coming out of the automatic resizing code seriously degrades the images. PLus we have a plain cream BG colour which gets artifacts all over it. What's going on?? Is it perhaps possible to replace the PHP library that's doing the image processing with a better one? If we can't resolve this we'll be forced to manually save out the images at all sizes (which is easy using photoshop's batch function) and replace the ones prestashop creates (which looks to be a major headache as it seems to put them in different directories...) Any pointers would be great. Cheers! Link to comment Share on other sites More sharing options...
phrasespot Posted May 31, 2012 Share Posted May 31, 2012 Zip and attach to a post an original and the set of images generated from it by PrestaShop pls. Link to comment Share on other sites More sharing options...
eternalc Posted June 12, 2012 Author Share Posted June 12, 2012 Hi Phrasespot, Please see attached images. The source-file.jpg is, predictably, the source. I am of the opinion that the distortion appears as a result of the scaling operation, as the Thickbox variant appears not to have the background color distortion pattern (it was re-saved but not re-sized). These were saved with JPG quality setting of 100. Cheers, Rory presta images.zip Link to comment Share on other sites More sharing options...
eternalc Posted June 12, 2012 Author Share Posted June 12, 2012 Sorry - the file referred to above as "thickbox" is actually called "kd1021-Lavender-A". It was resaved but not resized. The issue is worse with the smaller images. Any feedback would be appreciated. Thanks Rory Link to comment Share on other sites More sharing options...
Carl Favre Posted June 12, 2012 Share Posted June 12, 2012 Hi eternalc, I do not get it. I do not see any issue with the resize of the source file. Could you post a screenshot of what is wrong with the resize? Link to comment Share on other sites More sharing options...
phrasespot Posted June 12, 2012 Share Posted June 12, 2012 (edited) I am of the opinion that the distortion appears as a result of the scaling operation True, and I am not sure if this is a solvable problem on PrestaShop's part. Using a pretty expensive Photoshop plugin, I can barely manage better results scaling a 995x1200 image to e.g. 123x148. Also bear in mind that we have to work with jpgs as source. Edited June 12, 2012 by phrasespot (see edit history) Link to comment Share on other sites More sharing options...
eternalc Posted June 13, 2012 Author Share Posted June 13, 2012 Hi Phrasespot, Thanks for doing the test. It's a bit hard to see at that size, but they do seem similar. My main issue is with the larger images used on product page etc, as the design calls for these to merge seamlessly into a page BG of the same cream colour as the jpeg. So any artifacts become even more obvious. As you can see the problem is with subtle (but pervading) pattern noise in the BG. This is not evident when I scale down from 1200 and save larger images (say 385x440) out of photoshop (I'll post a test image later). Regarding solutions/workarounds - 3 options perhaps: 1 - is it possible to replace the PHP image processing script in prestashop? 2 - Or is there an easy way to replace all the different sized prestashop-generated images with photoshop-saved ones? This would have the added advantage that you could use uncompressed source files (PSD) and add a sharpening filter as an action. The issue would be how to easily find and replace the files prestashop makes - they seem to be filed in different folders and locations in a slightly idiosyncratic way. 3 - failing that, is there a way to force prestashop to use different images? That way we could save all of a products images to 1 folder and relink them. Any thoughts on these options? Many thanks! Rory Link to comment Share on other sites More sharing options...
eternalc Posted June 13, 2012 Author Share Posted June 13, 2012 Hi again Heres a comparison image - I darkened a section of the BG to show the extent of the artifacting. Cheers Rory 1 Link to comment Share on other sites More sharing options...
Carl Favre Posted June 13, 2012 Share Posted June 13, 2012 Hi Rory, It is more striking with the images comparison. I will forward it to the developers. Link to comment Share on other sites More sharing options...
Carl Favre Posted June 13, 2012 Share Posted June 13, 2012 I have an answer from Alain one of our developer: Try to update on your server the GD library because the resize option is entirely based on it. So a newer version may fix this issue. Link to comment Share on other sites More sharing options...
phrasespot Posted June 13, 2012 Share Posted June 13, 2012 1 - is it possible to replace the PHP image processing script in prestashop? This is already answered by Carl I think 2 - they seem to be filed in different folders and locations in a slightly idiosyncratic way. Depending on whether you use the old image system or the new image system, they are either kept in /img/p/productid-imageid.ext or /img/p/i/m/a/g/e/i/d/imageid.ext where image id is assigned everytime you add an image to a product. I am afraid there is a bug though and you will find images outside this convention in /img/ directory. 3 - failing that, is there a way to force prestashop to use different images? That way we could save all of a products images to 1 folder and relink them. This is what old image system did but it may become unwieldy when there are a lot of products with a lot of images. Hopefully a later version of PS will introduce a media library à la WordPress and solve the type of issues you are facing. Link to comment Share on other sites More sharing options...
chris2407 Posted March 9, 2013 Share Posted March 9, 2013 Im having the exactly same problem. After i did upload my photos and prestashop generates the thumbnails, they all look bad. I can see pixels... did anyone find a solution for this problem? Link to comment Share on other sites More sharing options...
JeffV Posted March 9, 2014 Share Posted March 9, 2014 I'm also experiencing poor quality thumbnails in PS 1.5.6.1. Any suggestions? Link to comment Share on other sites More sharing options...
PBo34 Posted March 25, 2014 Share Posted March 25, 2014 (edited) Hi, Prestashop 1.5.6.2. Same problem. All my images are very bad quality, wether I use jpeg 10, jpeg 100, or png 0, I can't even see a difference in quality. My logo is in everycase equally blurred and distorted. I can't believe that there's no way to resize an image cleanly (prestashop can do it, so it is possible). Anybody has found a solution or a workaround yet? I'm just thinking it could be interesting to look at the filigrane module. So far, I've looked in ImageManager.php and saw nothing suspicuous, except this: imagecopyresampled seems to be a bilinear function. Better quality could be expected from a bicubic function? What do you think? Thanks. edit: fixed: the URL on my test site was still pointing to the prod site, so images didn't change because they were fetched from the prod site! Definitely silly I raised the quality to PNG 4, images are some 65% bigger, it's still not good, but too big is not good either. Obviously, some algorithms are not optimized, because Photoshop "save for the web" gives me much much better quality in a file size 2/3 smaller! If someone finds the good algorithm, he can make a very interesting module! Maybe it even exists ... Edited March 25, 2014 by PBo34 (see edit history) Link to comment Share on other sites More sharing options...
PBo34 Posted March 25, 2014 Share Posted March 25, 2014 And directly giving Prestashop 600x600 png images seems like a good idea, so it wouldn't have to resize for the thickbox, and no loss on the first compression. Link to comment Share on other sites More sharing options...
Housy Posted September 5, 2015 Share Posted September 5, 2015 Hello everybody I had the same issue. Images were resized with noisy and a bit gray background, even if the source image had a white background and even if my image preferences were set to the best quality. I have found a solution, it works well for me. SOLUTION!!! - I only tested it on my test PS 1.6.0.14 site 1. Go to folder "classes" and open file "ImageManager.php" 2. Go to line 245: imagecopyresampled($dest_image, $src_image, (int)(($dst_width - $next_width) / 2), (int)(($dst_height - $next_height) / 2), 0, 0, $next_width, $next_height, $src_width, $src_height); 3. Change "imagecopyresampled" php function with "imagecopyresized": imagecopyresized($dest_image, $src_image, (int)(($dst_width - $next_width) / 2), (int)(($dst_height - $next_height) / 2), 0, 0, $next_width, $next_height, $src_width, $src_height); Hope this solves your problems. Regards, Housy Link to comment Share on other sites More sharing options...
Housy Posted September 6, 2015 Share Posted September 6, 2015 Well i have checked some images and this is not the best option to do to be honest. If you replace php image function, you will get images without noisy gray background but it is worse image quality, so i'm asking you guys, if there is any other way to stay with current "imagecopyresampled" php function, except image would have white background as it is in the source image? Thank you and best regards, Housy Hello everybody I had the same issue. Images were resized with noisy and a bit gray background, even if the source image had a white background and even if my image preferences were set to the best quality. I have found a solution, it works well for me. SOLUTION!!! - I only tested it on my test PS 1.6.0.14 site 1. Go to folder "classes" and open file "ImageManager.php" 2. Go to line 245: imagecopyresampled($dest_image, $src_image, (int)(($dst_width - $next_width) / 2), (int)(($dst_height - $next_height) / 2), 0, 0, $next_width, $next_height, $src_width, $src_height); 3. Change "imagecopyresampled" php function with "imagecopyresized": imagecopyresized($dest_image, $src_image, (int)(($dst_width - $next_width) / 2), (int)(($dst_height - $next_height) / 2), 0, 0, $next_width, $next_height, $src_width, $src_height); Hope this solves your problems. Regards, Housy Link to comment Share on other sites More sharing options...
prestalearn Posted December 22, 2015 Share Posted December 22, 2015 Did anyone find a solution for this? Im getting gray blur added to images with #FFFFFF backgrounds when compressed by prestashop as well Link to comment Share on other sites More sharing options...
tuk66 Posted December 23, 2015 Share Posted December 23, 2015 Have you tried to set "Use PNG for all images." under Preferences > Images? Link to comment Share on other sites More sharing options...
it_mihai Posted March 24, 2016 Share Posted March 24, 2016 In Classes > ImageManager.php find public static function imagecopyresampled(&$dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h, $quality = 3) and replace $quality = 3 with $quality = 5 (or 4) you have to test it you can try in BO > preferences > images set "Generate high resolution images" to YES 1 Link to comment Share on other sites More sharing options...
DennyG Posted August 3, 2016 Share Posted August 3, 2016 I also was confused with this issue. What I did is that I set the image size for home_default, large_default and thickbox_default exactly the same as the original images I imported adding the products (1200x1200 px in my case). So PrestaShop did not resize them and the result is just perfect. It is important, however, not to set the size bigger than the original image, since then it will appear smaller size in the front office. 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