I have installed the third-party tools on the server to optimize images and I still get “Image Optimization Tool is not installed” message.
The Google Page Speed Optimizer uses four third-party tools to optimize images, such as jpegoptim, optipng, gifsicle and cwebp.
In case the tool is installed on the server and the extension still shows the message “Image Optimization Tool cwebp is not installed” (the content of the message may differ depending on the tool which is not visible for the extension), the actual path to the tools should be indicated in the extension files.
Here is the example for WebpOptimization tool configuration with added path to the corresponding file: /code/Amasty/PageSpeedOptimizer/Model/OptionSource/WebpOptimization.php
The whole directory should be added to the nodes: command, command and result.
const WEBP = [
'name' => 'cwebp',
'command' => 'usr/bin/cwebp %f -o %o',
'check' => [
'command' => 'usr/bin/cwebp -help',
'result' => 'usr/bin/cwebp [options]'
Thus the same code modification should be made with the following files depending on the tool which is indicated in the error message:
In addition to this, if the extension is installed via composer, the necessary files can be found in the following directory: vendor/amasty/module-page-speed-optimizer/Model/OptionSource/ .
See more details on Google Page Speed Optimizer for Magento 2 page