Skip to content

The Perch Image Optimiser reduces the size of uploaded images.

License

Notifications You must be signed in to change notification settings

RedFinch/Perch-Image-Optim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image Optimiser

The Perch Image Optimiser will compress images that are generated by the CMS. This will improve loading times reduce the bandwidth required for your site.

Admin

Prerequisites

Before installing this package your site must be hosted on an environment that allows you to install and run other software through PHP such as a VPS. The application makes use of the following utilities:

Installing

To install the above on Ubuntu:

sudo apt-get install jpegoptim
sudo apt-get install optipng
sudo apt-get install pngquant
sudo npm install -g svgo
sudo apt-get install gifsicle

MacOS (Homebrew):

brew install jpegoptim
brew install optipng
brew install pngquant
brew install svgo
brew install gifsicle

Installation

Requirements

  • PHP >= 7
  • Perch / Runway >= 3.0

Adding to Perch

Upload the redfinch_optim directory to perch/addons/apps. Once complete you should see the app appear in the sidebar menu.

If not already, you should enable Scheduled Tasks for the optimisation tasks to be automatically run.

Configuration

Once installed there are a wide variety of settings that can be modified depending on your requirements:

  • Enable or disable optimisation tools
  • Set the compression amount
  • Strip file meta data for smaller sizes
  • Enable or disable SVG optimisation plugins

Performance

The optimiser task will run once every 24 hours and will use a high level of CPU power to compress images. If you find that this is too much you can:

  1. Reduce the compression level. PNG optimisation can be particularly resource intensive
  2. Increase the image quality
  3. Disable the particular optimiser.

You can additionally set a max execution time in the Perch settings panel. By default this is set to 30 seconds.

Limitations

This addon will only work for images that are stored locally. Files using cloud storage providers such as Amazon S3 cannot be optimised using this tool.

If you are not on a platform that can install and run the tools listed in the prerequisites section then the official Perch Kraken application may be suitable.

Credits

Spatie and Freek Van der Herten for the Image Optimizer package.

About

The Perch Image Optimiser reduces the size of uploaded images.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages