Limit JPEG quality to a maximum with jpegoptim
reduce jpg quality to 82 command line | compress large jpegs more aggressively | lossy compress images linux | compress existing wordpress uploads | jpegoptim | jpeg | images | compressionWarning, destructive. This command deletes, overwrites or changes data in a way that cannot easily be undone. Check every placeholder carefully and make a backup first.
find /var/www/vhosts/example.com/httpdocs/wp-content/uploads -type f \( -iname '*.jpg' -o -iname '*.jpeg' \) -exec jpegoptim --strip-all --preserve --max=82 {} +Re-encodes every JPEG whose estimated quality is above the maximum at that quality. Images below it are only optimized losslessly. Values around 80 to 85 usually show no visible difference for web images and often save a third or more.
Note: Lossy and in place: the original quality cannot be restored afterwards. Always back up the directory first. Package jpegoptim.
Also searched as
- reduce jpg quality to 82 command line
- compress large jpegs more aggressively
- lossy compress images linux
- compress existing wordpress uploads