If EWWW Image Optimizer fails to optimize images, one possibility is a file or directory permission problem. file and directory permissions in Linux control their operability (read, write, execute).
If proper permissions are not set for the EWWW working directory, image optimization may fail. To resolve this issue, change the permissions on the EWWW working directory using the following command
chmod -R 755 /var/www/html/wp-content/ewww/
This command sets the permissions of the /var/www/html/wp-content/ewww/ directory and
all files and directories under it to 755. This means that the owner will have all read, write, and execute permissions, while the group and other users will have read and execute permissions.