cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2 Change product image file size while upload

Magento 2 Change product image file size while upload

Need to Change product image file size while uploading image 

Image compress to less than 200kb 

6 REPLIES 6

Re: Magento 2 Change product image file size while upload

Hi @akshaykamba454 

Kindly refer below link for resize image while uploading:
https://docs.magento.com/user-guide/catalog/product-image-resizing.html

It may help you.
If issue resolve, please click on 'Kudos' & Accept as Solution!

Problem solved? Click Accept as Solution!

Re: Magento 2 Change product image file size while upload

@Bhanu Periwal  I want to automatically resize the images to below 150K after uploading

Re: Magento 2 Change product image file size while upload

Hi @akshaykamba454 

You can this command for resize all images automatically:

php bin/magento catalog:images:resize


It may help you.
If issue resolve, please click on 'Kudos' & Accept as Solution!

Problem solved? Click Accept as Solution!

Re: Magento 2 Change product image file size while upload

@Bhanu Periwal Thanks for reply 

I have checked above that seems to be correct

Is there anyway  while uploading image get compress or resize??

Re: Magento 2 Change product image file size while upload

@akshaykamba454 

You can compress images directly by run below command:

# apt-get install jpegoptim 
or
$ sudo apt-get install jpegoptim

Kindly refer below link :
https://www.tecmint.com/optimize-and-compress-jpeg-or-png-batch-images-linux-commandline/

It may help you.
If issue resolve, please click on 'Kudos' & Accept as Solution! 

Problem solved? Click Accept as Solution!

Re: Magento 2 Change product image file size while upload

Have you tried to convert images to WebP format with the Magento 2 WebP Images Extension?

With this module, you can set the % of quality yourself and by that define the size of the image. And there is not only an automatic conversion but manual and 2 other conversion types in case you want to try some other way.

It will definitely improve your website loading speed if that's your main goal.