0

I've uploaded some product images both with csv import and backend interface of magento 2.3 and I noticed that the file size on the frontend is 3x the size of the file I uploaded.

For example, I uploaded a 1200x1200px image (with custom Huffman lossless compression) around 600Ko. After Magento process the image the file is 2.2Mo on the frontend!

I've disable Frontend Image Resize on the backend and tried both GD2 and ImageMagick processor but it doesn't change anything !

Is there a way to disable image processing and just tell Magento to link Images uploaded on var/import/product_images to the actual products without doing anything on the files ?

1 Answer 1

0

For disable image optimization you can disable the feature in Stores -> Configuration -> Advanced -> System

enter image description here

Since 2.4.4 you can change image processing with external CDN and change Catalog media URL format to Image optimization based on query parameters in Stores -> Configuration -> General -> Web -> Url Options for prevent image processing

enter image description here

For you version you can create plugin with custom logic for \Magento\Catalog\Model\View\Asset\Image

4
  • Thanks for the insight. Since I’m running Magento 2.3 and don’t plan on upgrading soon it doesn’t really help :/
    – Tony
    Jul 17, 2022 at 20:15
  • I ’m currently overriding ImageMagick.php (/magento/framework/image/adapter/imagemagick.php) and it’s promising : I got rid of the blur aspect by using adaptiveresize() instead of simple resize and I can keep color profile on main image by getting rid of stripimage(). The size of files generated are becoming correct but I still have a lot of work on this !! If anyone has come against this problem it would be of help! Thanks
    – Tony
    Jul 17, 2022 at 20:25
  • Based on my experience I have logic to improve quality and image size on server side and serve webp when client is support instead of customize Magento. I'm using ImageMagick to optimize to webp. Jul 17, 2022 at 22:07
  • I'll look into it. It's not implemented by default on magento 2.3 so I'll have to tweak imagemagick.php to obtain webp encoding. Just so you know Images are my job so quality and size improvement are already done (without loosing quality) before uploading to my server but I find it odd that Image processing is that poor on magento since it's part of Adobe : alternative like ImageOptim or Resmush are way better to handle Images !
    – Tony
    Jul 18, 2022 at 9:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.