Announcement

Collapse
No announcement yet.

Losslessly optimise JPGs (BEFORE caching!)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Losslessly optimise JPGs (BEFORE caching!)

    Hope this is in the correct forum. Didn't find any references to this program which seems to magically compress JPGs without any loss of quality.

    Am just beginning to improve the page load times of our site and Google PageSpeed recommended I optimise by losslessly compressing my JPG images, saving bandwidth without any loss of quality (and, hopefully, improving our Google ranking).

    It turned out to be pretty easy and all free - here is my walkthrough (for Windows):

    1) BACKUP your images. Copy your ActinicV9\Site1\images folder (or your equivalent) somewhere else. I don't want the blame if something goes wrong!

    2) Take a snapshot of your site (again, just in case).

    2) Download jpegtran.exe from http://jpegclub.org/jpegtran/ , save it in c:\jpegtran

    3) In Notepad, create this file and call it jpegtran.bat:

    Code:
    cd c:\ActinicV9\Site1\images
    for %%i in (*.jpg) do "C:\jpegtran\jpegtran.exe" "%%i" "%%i"
    Obviously, change the "c:\ActinicV9\Site1\images" if your images are elsewhere or the "C:\jpegtran\jpegtran.exe" if you saved that somewhere else.

    4) Double-click on the bat file you have created. This should now run all of the JPGs in that folder through jpegtran, compressing them (where possible) without losing any quality at all and overwriting the originals.

    5) Publish your site. You'll have time to make a coffee if you have many JPGs as they will all be uploaded.

    On one example of my pages (with quite a few product images), this saved 500KB and increased my PageSpeed rating from 54 to 68.

    I'm pretty sure you would have to do this before implementing browser caching to set an expiry date for your jpgs. Otherwise, your site will only start using the smaller images when the old ones expire. Or you'd have to change all your image names and links. I'm glad I did it this way round (optimising first), even though PageSpeed says caching is more important.

    #2
    Thanks for that post, Andy... very interesting

    I really believe it's worth taking the time to optimise a site (any website, not just an ecommerce one) in the way you describe. Not just for the sake of the all-important Google ranking, but also to create a faster, more pleasant user experience all round.

    I recently invested in a copy of NXPower Lite Desktop Edition, which I can heartily recommend. It'll squash not only JPEGs, but also PDFs, ZIP files, and Word/Excel/PowerPoint files. The reduction in size is in many instances nothing short of astonishing, especially in light of the fact that there appears to be no discernible loss of quality or readability.

    I also like the generous reduction in bandwidth which it offers, particularly on large PDF downloads!

    Comment

    Working...
    X