Magento 2 Image Optimisation InstallationImage Optimisation

« Back to Image Optimisation

Magento 2

You can install the module using Composer or you can manually install it using FTP.

  • Run the following commands in your Magento root directory to install the module using Composer.

    # Add the FishPig Composer repo
    composer config repositories.fishpig composer https://repo.fishpig.co.uk/
        
    # Install the module using Composer
    composer require fishpig/magento2-imageoptimisation:*
    
    # Enable the module in Magento 2
    php bin/magento module:enable FishPig_ImageOptimiser
    
    # Run the Magento upgrade system
    php bin/magento setup:upgrade
  • You can download the latest version of the module from the Downloads page.

    Extract the ZIP file and upload the files to your Magento site at the directory below:

    app/code/FishPig/ImageOptimiser

    When creating the folders, ensure you use the correct capitalisation.

    To complete the installation, run the following commands in a terminal.

    # Enable the module in Magento 2
    php bin/magento module:enable FishPig_ImageOptimiser
    
    # Run the Magento upgrade system
    php bin/magento setup:upgrade

To run the image optimisation system, enter the following command in the terminal:

php bin/magento fishpig:image_optimiser:run --limit=10

To view a report of all images processed, enter the following command in the terminal

php bin/magento fishpig:image_optimiser:report

Magento 1

You can install the module using Composer or you can manually install it using FTP.

  • Run the following commands in your Magento root directory to install the module using Composer.

    # Add the FishPig Composer repo
    composer config repositories.fishpig composer https://repo.fishpig.co.uk/
        
    # Install the module using Composer
    composer require fishpig/magento1-smushit:*

    To complete the installation, flush the Magento cache and log out and back in to the Magento Admin.

  • You can download the latest version of the module from the Downloads page.

    Extract the ZIP file and merge the files with your Magento root directory using FTP. If a modman file is present, you can ignore this file.

    To complete the installation, flush the Magento cache and log out and back in to the Magento Admin.

You can view the output of Smush.it at System > Tools > Smush.it.

Smush.it for Magento 1 uses the Magento CRON to optimise images automatically. If your Magento CRON is setup and running, Smush.it will also run. If your Magento CRON is not setup, you can find tutorials online explaining how to do this.

Alternatively you can setup Smush.it to run manually via the terminal by running the shell/smushit.php script.

Documentation