Optimize images jpg png CentOS
ou want to make your site faster ? maybe it is then an idea to optimize and compress png or jpg images via your SSH Terminal.
If you got a lots of images you can save many of bytes by just compress images without losing any quality and discrease your website page size.
First we going to install jpegoptim + optipng
First we go check how fast is your website and what your page size is
# yum install optipng
# yum install jpegoptim
How works optipng ?
How works optipng ?typescript
typescript
- Check your site on: http://tools.pingdom.com/fpt/ - SAMPLE: 1.87s Load time / 2.3 MB Page size - Check where your most images are e.g /storage/ or /images/Now we gonna start optimize PNG & JPG/JPEG!
# cd /home/user/domains/domain.com/public_html/storage/uploads/ # all images in current directory: jpegoptim *.jpg # or jpegoptim */*.pg (all directories) or 1 image: jpegoptim image1.jpg # all images in current directory: optipng *.png # or optipng */*.png (all directories) or 1 image: optipng image1.pngMore information: http://freecode.com/projects/jpegoptim http://optipng.sourceforge.net/ find -type f -name "*.png" -exec optipng {} \; find -type f -name "*.jpg" -exec jpegoptim --strip-all {} \; find -type f -name "*.jpeg" -exec jpegoptim --strip-all {} \;
JPG optimization
typescript
PNG optimization
typescript



