Page 1 of 1

8 bit png images being converted to 32 bit png images by OC

Posted: Mon Aug 27, 2018 4:28 am
by Dabnis
Hi All,
I am not sure if this happens in all versions of OC, but definitely in v3.0.2.0

I process my images via Adobe Fireworks & at times save some as 8 bit png's for reduced file size , performance etc.

I have just noticed today that OC converts these 8 bit png's from 8 bit to 32 bit. In my case changing a 98Kb image file into a 425Kb image file.

Needless to say the page load time drops dramatically with several 8 bit png images on one page.

Any help, advice, suggestions appreciated.

Thanks.
Dab

Re: 8 bit png images being converted to 32 bit png images by OC

Posted: Wed Aug 29, 2018 6:39 am
by MrPhil
What sort of processing is being done on these images when you upload them to OC? Are they at least being resized? Maybe OC is defaulting to 32 bit image output rather than respecting the original settings. What happens if you provide your images in the final desired size (or anything else that processing changes)?

Re: 8 bit png images being converted to 32 bit png images by OC

Posted: Wed Aug 29, 2018 3:36 pm
by Dabnis
The images in question are those being used for the Home page banner extension. They are getting resized to the pre-set banner size with .1120x450.png being added to the post processed image file name. As I said previously, I up load 8 bit png & any processing by OC results in 32 bit png.

Just reading your reply : Of the images being uploaded (2 of them) one is exact required size, other is slight larger (by about 5%), but both are affected by the issue.

As all other images on the store are jpg they are not affected by this issue.

Regards. Dab

Re: 8 bit png images being converted to 32 bit png images by OC

Posted: Wed Aug 29, 2018 8:31 pm
by MrPhil
OK, so it sounds like even a simple upload (no resizing or other real processing) is ignoring original properties (like bpp) and imposing its own default properties. At this point, it will take someone familiar with this area to determine what's going on. My guess would be that the code would need to query the existing image properties, and use those if possible, rather than just use fixed defaults like 32bpp.

Re: 8 bit png images being converted to 32 bit png images by OC

Posted: Wed Aug 29, 2018 8:43 pm
by Dabnis
I agree entirely, it is why I raised the topic as the SEO implications given Google's recent focus on page load speed are potentially huge.
Here's hoping that one of the core development team picks this up and implements a fix.

I am assuming that it will have something to do with whatever PHP graphics library they are using & hopefully just a change of settings!

Regards.
Dab

Re: 8 bit png images being converted to 32 bit png images by OC

Posted: Wed Oct 10, 2018 4:30 am
by ADD Creative
If the image is the exact size for the banner it should not be resized and just copied instead. The code that does this this is below. So uploading the image with the correct size should prevent any optimisations from being lost. Check your image sizes match the size of any banners they are used in.

https://github.com/opencart/opencart/bl ... hp#L32-L38