papagino Posted April 4, 2014 Share Posted April 4, 2014 Hey folks, I've created PNGs images for my categories, the images are made with Photoshop to the size in px that match the Category images specified in Backoffice's Preferences/images category_default that is 870px x 217px. I then used RIOT (Radical Image Optimization Tool) to optimize my images in jpegs. I then configured the JPEG quality setting to 100 (Top Quality) under the Backoffice Preferences/Images option and then I uploaded my images. The results My uploaded image = 14.4kb Prestashop processed image = 20.11kb How can Prestashop doing a minimal image compression on a file render the image file bigger that the original??? Is there a way to disable Prestashop's image Optimisation? Cause setting image setting to 100 is not disabling it? Cheers Daniel Link to comment Share on other sites More sharing options...
Bill Dalton Posted April 4, 2014 Share Posted April 4, 2014 Did you set PNG images to Zero? Link to comment Share on other sites More sharing options...
Bill Dalton Posted April 4, 2014 Share Posted April 4, 2014 (edited) Right ... you changed them to jpg. Sorry. I should have paid more attention. Edited April 4, 2014 by Bill Dalton (see edit history) Link to comment Share on other sites More sharing options...
Bill Dalton Posted April 4, 2014 Share Posted April 4, 2014 You know that is something I never looked at. I just checked you are right. PS is increasing the image size. I had thought by setting it at 100 it would just NOT do any processing. So good question! Link to comment Share on other sites More sharing options...
papagino Posted April 4, 2014 Author Share Posted April 4, 2014 Ya, it would be nice to have an option to disable Prestashop "image optimization"... So we would have control of the file size of images that appears on our website. As of now, we don't ( Hopefully, this will come on a later update. Cheers Daniel Link to comment Share on other sites More sharing options...
Bill Dalton Posted April 5, 2014 Share Posted April 5, 2014 // If PS_IMAGE_QUALITY is activated, the generated image will be a PNG with .jpg as a file extension. // This allow for higher quality and for transparency. JPG source files will also benefit from a higher quality // because JPG reencoding by GD, even with max quality setting, degrades the image Found the above content in ImageManager.php So it appears that the increase in file size is because the images are actually converted into png format and then renamed as jpg. This is to allow for better image quality and transparent background. It's late, so this is as far as I'm going with this today. But I find this interesting and I think it is an important issue. I have searched the forums and Google and can find NOTHING on the subject. I'm amazed. I'll be looking more into this in the coming days. 1 Link to comment Share on other sites More sharing options...
papagino Posted April 5, 2014 Author Share Posted April 5, 2014 Interesting, I found that uploading top quality PNGs will give better image quality and with a smaller file size then uploading a JPG. So, that confirms your findings above. So for now, my choice is clear, I will be uploading PNGs instead of JPGs. Cheers Daniel Link to comment Share on other sites More sharing options...
Bill Dalton Posted April 5, 2014 Share Posted April 5, 2014 (edited) I'm glad the OP posted about this. I had just assumed that if the JPEG quality was set to 100 then PS would not have a negative effect on my image. But as it turns out new images must be created from the original. This is because large PHP applications use the images in different ways and sizing. This is a feature that saves us much work and makes working with the images much easier. PS and pretty much all PHP applications use http://www.php.net/manual/en/book.image.php for image processing. If you do some reading about the quality of PHP image processing you will learn that it is not the quality of Photoshop. The image processing routines are actually very good but they must be able to run on a variety of hardware and software environments. It would be wishful thinking to expect the same level of image processing that a high-end software program like Photoshop can achieve. The good news is that Prestashop has some code that helps to overcome some of the shortfalls that are part of PHP GD. The renaming of JPEG images using a lossless PNG routine is a good example. That said, if you are concerned with image file size, perhaps the images settings are not intuitive enough. For example I had been setting JPEG quality at 100 percent, and going forward I will now use the following settings that seem to give me the best match of what I feed PS and what is created by PS. Image quality: Use PNG only if the base image is in PNG format (as we now know, this setting seems to only effect the file name extension, the format is PNG regardless) JPEG quality: 96 PNG quality: 0 With the above settings my image ends up very close to the same original size. There is no visible loss in quality. This may be because PS is actually using a lossless PNG format to overcome image quality problems that are in the PHP GD routines. Edited April 5, 2014 by Bill Dalton (see edit history) 1 Link to comment Share on other sites More sharing options...
Bill Dalton Posted April 5, 2014 Share Posted April 5, 2014 I'm also getting good results with JPEG quality: 80 The files size is almost 50% less and the image quality is still very good. Link to comment Share on other sites More sharing options...
papagino Posted April 5, 2014 Author Share Posted April 5, 2014 (edited) Thank you for all your research and feedback Bill. I am also having trouble with the courier tracking feature of Prestashop 1.6.0.5 that I posted here: http://www.prestashop.com/forums/topic/320958-prestashop-1605-tracking-links-not-clickable-blank-in-emails-sent-to-customer/?do=findComment&comment=1623842 I did not get any replies yet for this post... Maybe you can help... Cheers Daniel Edited April 5, 2014 by papagino (see edit history) Link to comment Share on other sites More sharing options...
Mister Denial Posted April 9, 2014 Share Posted April 9, 2014 Okay, I am glad I am not alone with this issue. I was playing with the default bootstrap theme of 1.6 and replaced the banner images by my own images (none larger than 25K - 35K), and suddenly Gtmetrix shows my pages is now 1.5 Mb in size whereas it used to be less than 750K. WTF !?! And guess what? My 25K images are now all about 150-200 K each! WOW! I also had assumed that if you upload a highly optimized image into Prestashop, it would not inflate the size. It maybe is not a bug, but definitely a feature that needs improving. Link to comment Share on other sites More sharing options...
Bill Dalton Posted April 9, 2014 Share Posted April 9, 2014 I'm getting good results now with the settings above. Images a great and file size is smaller than original. Best of both worlds. Link to comment Share on other sites More sharing options...
Mister Denial Posted April 9, 2014 Share Posted April 9, 2014 Thanks Bill, I just tried with JPG 80 and PNG 7 / only if base image is PNG, looks good so far, smaller size as original indeed, and I can't notice any major quality loss. Great! Thanks a lot for that trick! Link to comment Share on other sites More sharing options...
Recommended Posts