Getting the Best JPEG Quality and File Size

As I’ve mentioned in a prior tutorial on Lossless JPEG Rotation, through the years of experience, I find that setting JPEG Quality to 75% would yield the best file size to quality ratio. JPEG or JPG is probably one of the most used image format because it uses a compression algorithm which provides the smallest possible file size amongst all the other 24 bit image formats and that is important when it comes to putting pictures on the web. You wouldn’t want to have to wait several minutes to view a picture on the ultra-expensive LTE mobile data line so file size is essential.

Of course, deciding on the good JPEG quality can really be hassle and takes a good number of experimentation to get you the best result. Off the bat, here is what we have done in terms of using different jpeg quality percentages on the same file.

JPEG Quality Comparison Listing
This shows the various file size of the same photo saved using different JPEG Quality Percentage

The numbers beside the filename is the JPEG Quality Percentage used. The above jpg photos were processed by Batch It Ultra. One which which may seems strange is that the file saved with JPEG Quality at 95% is larger than the 100%. There is a perfect explanation for this. In Batch It Ultra, when the JPEG Quality is set to 100%, Batch It Ultra will intelligently try to guess the image quality of the original file and use that setting. It’s estimation so do expect a skew of about 3 to 8%. As mentioned in the prior tutorial, all images are loaded to the native uncompressed format while the application applies all the necessary changes before saving it.

Below are the three images at 95%, 75% and 30% JPEG Quality. (All Set to view at 500 x 375 pixels)

Photo at 95% JPEG Quality
Photo at 95% JPEG Quality – 423kb
Photo at 75% JPEG Quality
Photo at 75% JPEG Quality – 170kb
Photo at 30% JPEG Quality
Photo at 30% JPEG Quality – 76kb

The photos original dimensions is 1600 x 1200 pixels but when they get resized down to 500 x 375 pixels, they are visually identical. However, the underlining file size is drastically different. The takeaway here is that if you do not need to place images at full size, you can experiment with a lower JPEG Quality to give you a better mileage. Of course, when the photos are blown up, the quality is drastically different.

Here are the same photos blown up by 500%

The 95% JPEG Quality at 5x
95% JPEG Quality at 5x
75% JPEG Quality enlarge to 5x
75% JPEG Quality at 5x
30% JPEG Quality at 5x

To illustration the issue, we did add a yellow pixel on the Mandarin Duck’s feathers. It is not visible when the photo is viewed the smaller sizes but is visible when they are enlarged. Both the photos saved at 95% and 75%, there isn’t much different in terms of quality and it is possible to see the yellow pixel as a square but that square is not quite visible on the photo saved at 30% and at some parts of the photo, you will also notice pixelization.

So when deciding on what JPEG quality to set, we will have to take note of whether file size is a real priority. If it isn’t, the highest quality is always the best. But I believe that in most cases especially when you are putting the picture online or sending them as attachment, size matters. Under normal circumstances, I would say that setting it to 75% is the best as there is about a 45% reduction in file size without any visible quality loss. It is probably not that straightforward as the number of colors in the photo will play a major factor here but 75% is a good benchmark.

If you plan to downsize the photo, you can experiment with a lower JPEG Quality. Starting at 75%, you can drop 5% for every 10% reduction in file dimensions. Do experiment for the best ratio.

Leave a Reply