# Magento 2 Image Optimizer

### <span style="color: #3b82f6;">Installation and User Guide for Magento 2 Image Optimizer</span>

**Table of Contents**

1. [*Installation*](#bkmrk-installation)
    - *Installation via app/code*
    - *Installation via Composer*
2. [*Configuration Settings for Optimiser Base* ](#bkmrk-configuration-settin)
    - *General Settings*
3. [*Configuration Settings for Image Optimiser*](#bkmrk-configuration-settin-1)
    - *General Settings*
    - *Compress/Optimize Product Images*
    - *Compress/Optimize Category Images*
    - *Compress/Optimize CMS Images*

### <span style="color: #3b82f6;">Installation</span>

- <span style="color: #f97316;">**Installation via app/code:**</span> Upload the content of the module to your root folder. This will not overwrite the existing Magento folder or files, only the new contents will be added. After the successful upload of the package, run below commands on Magento 2 root directory.
    
    ```php
    php bin/magento setup:upgrade
    php bin/magento setup:di:compile
    php bin/magento setup:static-content:deploy
    ```
- <span style="color: #f97316;">**Installation via Composer:**</span> Please follow the guide provided in the below link to complete the installation via composer.

<p class="callout success">[https://docs.scommerce-mage.com/magento-2-extensions/installation-via-composer/installation-via-composer](https://docs.scommerce-mage.com/magento-2-extensions/installation-via-composer/installation-via-composer)</p>

### <span style="color: #3b82f6;">Configuration Settings for Optimiser Base</span>

Go to **Admin &gt; Stores &gt; Configuration &gt; Scommerce Configuration &gt; Optimiser Base**

#### <span style="color: #f97316;">General Settings</span>

- **Enabled –** Select "Yes" or "No" to enable or disable the module.
- **License Key –** Please add the license for the extension which is provided in the order confirmation email. Please note license keys are site URL specific. If you require license keys for dev/staging sites then please email us at <support@scommerce-mage.com>.

[![image - 2025-06-04T171029.130.png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-06/scaled-1680-/image-2025-06-04t171029-130.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-06/image-2025-06-04t171029-130.png)

### <span style="color: #3b82f6;">Configuration Settings for Image Optimiser</span>

Go to **Admin &gt; Stores &gt; Configuration &gt; Scommerce Configuration &gt; Image Optimiser**

#### <span style="color: #f97316;">General Settings</span>

- **Enabled -** Select "Yes" or **"**No**"** to enable or disable the module.
- **Compress Images while uploading (All pages, CMS, Category and Product):** Select available options to enable compression for new images uploaded via Magento admin. We recommend this to be enabled because all the new things will be compressed straight away.
- **Number of images to processed –** Define how many number of images you want to process when the cron job runs. Please note this number should be reasonable especially when you have multiple stores and many additional product images.
- **Include folders –** Please select list of folders you want to include for compressing the image.
- **Compress Cached Product Images (Yes/No) –** Select "Yes" to compress cached product images generated by Magento. We could recommend to leave this setting turned off especially when you clear your cached images frequently and you have more than 5 additional images on the product page.
- **Image Compression Provider –** Please select image compression provider. **Provider API URL: Provider API URL `smush it –`** [**`http://api.resmush.it/ws.php?img=`**](http://api.resmush.it/ws.php?img) **`imageoptim –`** [**`https://im2.io/{ {username} }/full/`**](https://im2.io/%7B%20%7Busername%7D%20%7D/full/) **`kraken.io –`** [**`https://api.kraken.io./v1/url`**](https://api.kraken.io/v1)
- **API Key –** Please enter API Key (if provider is kraken.io).
- **API Secret Key –** This will be required for certain providers like kraken.io
- **Exclude folders –** Please enter the list of folders you want to exclude from media directory (comma separated) for example foldername1, foldername2, /foldername /subfolder1, foldername/subfolder2
- **Backup Images (Yes/No) –** Select "Yes" to enable this feature to backup original images before compressing original file.
- **Debugging (Yes/No) –** Select "Yes" to enable debugging. This will write logs in var – log – imageoptimize.log
- **Image Optimiser Schedule –** Please define the Cron frequency to optimize images.

[![image - 2025-06-04T171111.674.png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-06/scaled-1680-/image-2025-06-04t171111-674.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-06/image-2025-06-04t171111-674.png)

- <span style="color: #f97316;">**Compress/Optimize Product Images -**</span> You can compress product images by enabling module from **Admin &gt; Stores &gt; Configuration &gt; Scommerce Configuration &gt; Image Optimiser &gt; Enabled - "Yes" &gt; Compress Images while uploading -** Select **"Product ".**

**[![image (87).jpg](https://docs.scommerce-mage.com/uploads/images/gallery/2025-06/scaled-1680-/image-87.jpg)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-06/image-87.jpg)**

- <span style="color: #f97316;">**Compress/Optimize Category Images -**</span> You can compress category images by enabling module from **Admin &gt; Stores &gt; Configuration &gt; Scommerce Configuration &gt; Image Optimiser &gt; Enabled - "Yes" &gt; Compress Images while uploading -** Select **"Category ".**

**[![image (88).jpg](https://docs.scommerce-mage.com/uploads/images/gallery/2025-06/scaled-1680-/image-88.jpg)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-06/image-88.jpg)**

- <span style="color: #f97316;">**Compress/Optimize CMS Images -**</span> You can compress CMS images by enabling module from **Admin &gt; Stores &gt; Configuration &gt; Scommerce Configuration &gt; Image Optimiser &gt; Enabled - "Yes" &gt; Compress Images while uploading -** Select **"CMS ".**

**[![image (89).jpg](https://docs.scommerce-mage.com/uploads/images/gallery/2025-06/scaled-1680-/image-89.jpg)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-06/image-89.jpg)**

If you have a question related to this extension please check out our [**FAQ section** ](https://www.scommerce-mage.com/magento-2-image-optimizer.html#customfaq)first. If you can't find the answer you are looking for then please contact [**support@scommerce-mage.com**](mailto:core@scommerce-mage.com)**.**