Jump to content

Is there a way to disable Prestashop image optimisation?


Recommended Posts

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

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 :o(

 

Hopefully, this will come on a later update.

 

Cheers

 

Daniel

Link to comment
Share on other sites

  // 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.

  • Like 1
Link to comment
Share on other sites

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

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 by Bill Dalton (see edit history)
  • Like 1
Link to comment
Share on other sites

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 by papagino (see edit history)
Link to comment
Share on other sites

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

×
×
  • Create New...