Optimize JPEG images losslessly with jpegoptim
lossless jpg compression linux | shrink images without quality loss | run jpegoptim on uploads folder | remove metadata from jpeg | jpegoptim | jpeg | images | findCaution: This command changes the system. Understand what it does before you run it.
find /var/www/vhosts/example.com/httpdocs/wp-content/uploads -type f \( -iname '*.jpg' -o -iname '*.jpeg' \) -exec jpegoptim --strip-all --preserve {} +Optimizes the Huffman tables of each JPEG without re-encoding, so the pixels stay identical. --strip-all removes EXIF, comments and color profiles, --preserve keeps the modification time. The output shows the savings in percent for each file.
Note: The files are overwritten in place, and removed metadata (copyright, camera data, ICC profile) is gone afterwards. Install the jpegoptim package if needed and make a backup first.
Also searched as
- lossless jpg compression linux
- shrink images without quality loss
- run jpegoptim on uploads folder
- remove metadata from jpeg