As a blogger, I have a habit of managing photos in Lightroom and export them as JPEG files before adding them into my post. They are usually in reduced size of about 400KBytes per photo. If you use web analyzer tool such as PageSpeed or YSlow to analyze your pages, it will complain that your pictures can be further reduced in size. This applies even you use "Save for web" option in Photoshop.
Why Lightroom/Photoshop from the big company does not fully compress our JPEG files are beyond my knowledge. PageSpeed suggests us to use image compressor such as jpegtran, a command prompt tool to further compress JPEG files in batch. Fortunately for mac users, there is an open source GUI tool called ImageOptim. ImageOptim has a very simple user interface. Basically it allows you to drag and drop folders/files to its main window and the compression will start automatically. It will overwrite original files so make sure you backup your JPEG files before proceeding.
Before adding images for compression, let's check on ImageOptim preference. Personally, I prefer to keep JPEG metadata for copyright purposes so I unchecked "Strip JPEG metadata". Removing JPEG metadata will further reduce the file size but this will also remove the ownership information.
The steps are pretty straightforward. Below are steps I used to optimize images which were already in my server:
- Zip and download images from remote server to local drive.
- Make a copy of the Zip file for backup purpose.
- Extract the Zip file.
- Drag-and-drop image folders to ImageOptim. Compression will start automatically.
- Zip all the processed images.
- Upload it to your FTP server.
- Remove exisiting image folders in remote server.
- Extract the Zip file.
That's it. Re-run PageSpeed or YSlow and it should now make less complaint on your image files.