Magento 2 Image Optimizer by Mageplaza

- E-Commerce, Magento 2

magento 2 image optimizer extension

According to a study, 79% of shoppers who are discontented with website performance are less inclined to come back. So what can we do to attract customers to visit and revisit our website? It’s improving page loading speed.

And one of the most popular ways to boost the page speed is to optimize your images. Magento 2 Image Optimizer by Mageplaza is a robust tool to compress and optimize photos. The extension can rocket page loading speed, improve user experience, and accelerate conversion rates efficiently.


Get Magento 2 Image Optimizer Extension by Mageplaza

What makes the Mageplaza Image Optimizer extension essential for Magento 2 stores?

Speed up websites by optimizing images of multiple types

magento 2 image optimizer extension

The Image Optimizer extension allows store owners to compress a number of types of images, including JPG, GIF, PNG, TIF, and BMP. These are the most common image formats that every online store uses to upload photos of their products or services. Compressing the photo size will boost the performance of the store site.

With this module, the store admin can brighten the images on the website conveniently in the backend with a few clicks.

Image optimization quality – Lossless or Lossy

magento 2 image optimizer extension

Remarkably, Image Optimizer enables store admins to decide compression levels. There are two compression options: Lossless and Custom (Lossy). The two types will make a big difference in image quality and file size.

Lossless is a data compression filter that lets you retain image quality while decreasing the file size. Lossless will eliminate inessential metadata from image files.

Meanwhile, Lossy compression means that there is a lack of data in the original image file. This type of compression can reduce the file size significantly but may affect the quality of images.

Besides, Magento 2 Image Optimizer module allows users to set the quality percent they would retain after the compression process. Uses can take control over the compression level and image quality.

Automatic optimization process

magento 2 image optimizer extension

The image compression can be activated frequently with the help of Cron. The store admin doesn’t need to compress manually when the Cron function is turned on.

The module will periodically scan to inform admins of the optimization status of available images. Then, the optimization process will be enabled at a specific time regularly to compress the scanned images. Both optimization and scan actions can be automatically activated by Cron, which saves store owners much time.

Include and exclude image directories

magento 2 image optimizer extension

The scanned image can be assigned to the particular directories of the store site. Within the admin backend, users can decide the included directories whose images are scanned and the excluded ones which are not scanned.

The directory separation saves a lot of time for the scanning process. Some directories requiring original images with full quality are not considered in the optimization process.  

Backup original images

magento 2 image optimizer extension

Automatic backup by Image Optimizer secures the original image and helps store admins to roll-back any image if needed. All backup images are saved in a specific image directory.

The backup function can help users implement image modifications freely without worrying about the loss of the original version.

Extra features

Force file permission

With the Image Optimizer module, store admins can assign access rights to the optimized image path by number. For instance, 777 refers to no limitation on permissions, including reading, writing, and implementing.

Record, re-queue, and restore

This amazing tool will record all scanned paths, optimization status, optimized size, optimized percent, original size, and error messages. Moreover, the extension enables changing optimized images to pending status and supports restoring optimized images to original versions.

Support running the module manually

The store admin can optimize images manually by choosing the Optimize button at the Manage Images grid.

Skip transparent images

The module supports skipping transparent images during the optimization process.

 Bulk compression

Users can choose multiple image paths and compress at one time.

Command line

The extension includes the command line to optimize images more effectively.


General configuration

magento 2 image optimizer extension

Within the Admin Magento, go to Stores > Image Optimizer > Configuration

magento 2 image optimizer extension

  • Enable: Choose Yes to activate the module features. The extension supports image types, including PNG, JPG, TIF, GIF, and BMP.
  • Backup Image: If you choose Yes, the original image will be backed up at var/ backup_image directory before getting optimized.

Optimize Options

magento 2 image optimizer extension

  • Image Quality: Choose the image optimization level between 2 types:
    • Lossless: A data compression filter that does not lower the image quality but requires uncompressed images before they can be rendered.
    • Custom: A filter that can eliminate some data. Remember that this filter can reduce image quality. After you select Custom, more fields are shown:
      • Quality Percent: Fill in the percent in the Quality percent field, which is restricted between 1 and 100. For good image quality, you should maintain the quality above 90. If you leave this field blank, the default value is 92.
  • Skip Transparent Images: If you select yes, the white or transparent images will be skipped in the optimization process. If you wish to optimize these transparent images, you should Restore and Requeue them. In case you choose No, all the transparent photos will be optimized.
  • Force File Permissions:
    • If you choose No, there is no change in the image permission.
    • If you select Yes, you’ll give permission for optimized images. There shows up more fields:
      • Select Permission:
        • Fill in the number showing the permission in the Select Permission field to decide the permission types for optimized images.

Scan Directory

magento 2 image optimizer extension

  • Included Directories:
    • Click on the Add button to insert the path into the path field. The inserted path will be scanned with images in that path. For instance: pub/media/catalog/product, pub/media/customer.
    • If this field is left blank, the default directory of pub/media/ will be scanned. Click on Remove to clear the inserted path.
  • Excluded Directories:
    • Choose the Add button to insert the path where you don’t want to scan the image in that folder. For instance: pub/media/mageplaza, pub/media/logo.
    • If the field is left empty, there is no restriction to scan images with paths. Click on Remove to clear the path if you want to optimize the path.
  • Notice: If the path is in both Included Directories and Excluded Directories, the scan with that path will not be applied.

Cron job

magento 2 image optimizer extension

  • Enable Image Scan: Choose Yes to automatically scan images after a specific period of time and show more fields:
    • Scan Schedule: Fill in the time in the Scan Schedule field; after the selected time, the image will be scanned. For instance:
      • Insert ***** is every one minute the image will be scanned.
      • 20 * / 3 * * * is every 3 hours and 20 minutes the image will be scanned.
      • Run Daily: 00 *** means the scan process will run at 00:00 every day.
      • Run Weekly: 00 ** 7 means the scan runs at 00:00 Sunday; 00 ** 1 means the scan runs at 00:00 Monday.
      • Run Monthly: 001 ** means the scan runs at 00:00 on 01/01/2020.
      • Notice: When inserting values, between two values linked by spaces, you start running scans. For instance: * * * * *
  • Enable Optimization: Choose Yes to automatically optimized scanned photos after a specific time and show more fields:
  • Optimization Schedule: Fill in the time in this field; after the selected time the scanned images will be optimized. Unscanned images will not be optimized.
  • Limit Number of Images: Fill in the number of images that each time you want to optimize after the selected time period.

Manage Images

  • From the Admin Magento, go to Stores > Image Optimizer > Manage Images
  • This place stores scanned image information, including Path, Status, Original Size, Optimized Size, Error Message, etc.
    magento 2 image optimizer extension
  • Click on the Scan Images button to begin scanning all images. Only optimize the scanned images.
  • Click on the Optimize Images button to optimize the scanned images.
  • With Optimize Action, you can select to optimize each photo or all scanned photos without optimizing.
  • If you choose Restore, the image returns to the skipped status.
  • If you select Re-Queue, the image returns to the pending state.
  • Delete: Remove images that you don’t want to optimize
  • Progress: Recount the status of the image with Pending, Error, Skipped, and Success
  • A popup will appear when you click on Mass Action Optimized or Optimize Image. When the Optimize button is clicked, the Progress bar shows 0% and shows the first image. Click on Stop if you want to halt the optimization process.
    magento 2 image optimizer extension
  • When you click on Stop, a popup will appear with a message: Are you sure you want to stop optimizing images?  

magento 2 image optimizer extension

Command Line

Users can run the command below to optimize images faster. The number of photos after each optimization will depend on the value of the Limit Number of Images field in the configuration:

Moreover, you can run the following command to scan images according to the Scan Directory field in the configuration:


Thanks to Magento 2 Image Optimizer by Mageplaza, you will not need to worry about compressing and optimizing images, enhancing the site performance considerably. The fast loading speed will offer a better user experience and encourage shoppers to surf and view more items and services of an online store. The more time they spend on a shopping website, the more opportunities for sales. Install the extension today to run your online business better.

HOT DISCOUNT: Use coupon code FIREBEAR to receive a 10% discount when purchasing.

Get Magento 2 Image Optimizer Extension by Mageplaza