Slimage uses jpegoptim and optipng to compress your images during upload. It will compress the thumbnails that WordPress generates but will leave the original file intact, so that you can safely restore your changes if necessary.
The plugin will also allow you to manually set the compression level and quality on a per-image basis. That way you have absolute control on how much quality you are willing to sacrifice in order to achieve better performance improvements, which can be handy if you want to pass the Google PageSpeed test.
Using it in conjuction with the
wp media regenerate command of WP-CLI or with some thumbnail regeneration plugin, you can bulk optimize your photos and even experiment until you find the combination of quality/size that suits you.
To use the plugin you need to have
optipng installed on your server and make sure that PHP
shell_exec() function isn’t disabled in your
- Compress an image during upload.
- You can set a default level of compression for all newly uploaded images.
- You can override that compression level on a per-image basis.
- You can use all the available options of jpegoptim and optipng.
- Combining it with some image regeneration tool, you can bulk compress your existing images.
- The plugin leaves the original image intact, so that any change that you make can be reversible.
The main settings of the plugin, under Settings / Media.
The option to override quality for a specific image under the image’s edit page.
A sample of a few compression levels. The first image keeps the default WordPress compression and no Slimage compression applied (65.33KB). The rest of the samples are compressed with 60% (40.26KB), 50% (35.5KB), 40% (33.03KB), 30% (26.25KB), 20% (20.64KB) and 10% (13.3KB).