Google PageSpeed recommends applying slightly lossy compression to your images. While this may result in a minor, often unnoticeable, reduction in visual quality, it significantly educes image file sizes (in kilobytes). This optimization is crucial for improving your site's load speed, especially for users on mobile connections. We have a script available that you can run as a Cron Job to handle this process:
~/bin/image_optimize_lossy.sh
An example of how you can set up a cron job is shown below:
25 2 * * * flock -n $LOCKDIR/imgopt $HOME/bin/image_optimize_lossy.sh &>>$IMGLOG
The script will back up images in ~/backup before making changes. If you wish to compress lossless, meaning the image won't change visually but its byte size is reduced significantly (but less), use the following script:
~/bin/image_optimize_lossless.sh
Was dit artikel nuttig?
Dat is fantastisch!
Hartelijk dank voor uw beoordeling
Sorry dat we u niet konden helpen
Hartelijk dank voor uw beoordeling
Feedback verzonden
We stellen uw moeite op prijs en zullen proberen het artikel te verbeteren