The Compromise of the Jpeg Format

As mentioned in the digital formats blog last week, each time you edit and save a jpeg file a process takes place that aims to reduce the size of the resulting file. This entails making some approximations about the content (the colour) of some pixels. Repeatedly saving a jpeg file will, therefore, degrade its quality.

Whenever you save a jpeg file, most programs will offer you a choice as to the trade-off you would like to make between the size and the quality of the file you are going to create. In the illustration here, I am choosing to save the best quality file, but it will be the largest. I could change my choice by moving the slider, entering a different number, or choosing a quality other than “maximum”. This illustration is from the Photoshop program. Different programs offer variations on this, but the result is always that you are making a choice between quality and size of file.

Jpeg quality versus file size

Note: merely viewing your jpegs (as opposed to editing and then saving them) will NOT degrade the image. And neither will time! Real, hard copy photographs do degenerate over time as chemical processes take their toll. Digital images on your computer will not suffer this fate.

 

Images as Email Attachments

If you are intending to send an image file as an attachment to an email then size matters. An image of acceptable quality saved as a jpeg could be 200kb or smaller, whereas the tif equivalent could be 20mb. The former would be perfectly acceptable as an email attachment, whereas the latter may not be delivered. As far as emailing jpegs is concerned, you can almost always save the jpeg at its highest quality and still have a file that will comfortably go through the email system. You can see in the first illustration that the file I am saving here would be 153.0k. This would be perfectly acceptable as an email attachment.

Quick reminder on file sizes: there are approx 1000kb in 1mb (one thousand kilobytes in a megabyte). An email attachment can be 5mb without causing problems and some email systems can handle attachments up to 20mb. Therefore, any file size that is expressed in kb (and is less than 5000kb) is less than 5mb. Therefore, any file size expressed in kb (provided that it is less than 5000kb) will be ok to send by email.

The Best of Both Worlds

If you only intend to edit a photograph once or twice then it’s probably OK (quality-wise) to save it each time as a jpeg. The quality will remain acceptable and it won’t cause problems by being too large. If, on the other hand, you are going to do a lot of editing, spread over several sessions, then it is worth getting to grips with how you can save an image in a “lossless” format such as tif or bmp, so that it doesn’t degrade each time you save it. When you have finished editing it you can save the final version as a jpeg so that you then get the benefit of compressing it without all the intervening stages of degradation. If you do this, by the way, you will finish by having a file in each of the jpeg format and the “lossless” format.

Whatever program you are using to edit your pictures, the way to save an image file in a different format is to find the command to “save as” (as opposed to the “save” command) and then look for an option to allow you to change the format. This illustration is from Photoshop:

Saving a file in a different format

In this instance, clicking on the triangle to the right of the “Format:” line offers many options for saving the file in a different format, including tif. When you have finished all the editing and want to create a final, smaller, jpeg file then just issue the “save as” command again and choose jpeg as the final format.

Zipping Image Files

Files can usually be compressed into smaller sizes by putting them into zip files (or other compressed formats such as rar). These can then be sent more easily through the email system. Zipping also has the advantage that only one file is sent, so it is easier to handle than trying to attach, say, 20 photograph files. The recipient then “unzips” the file back into its original components.

There is no reason why you cannot put jpeg files into zip files, but you won’t save much space. The jpeg has already been optimised, so the process of “zipping” it won’t squash it much more – if at all. Zipping “lossless” files (such as tif files) will reduce the overall size considerably and won’t compromise the quality of the image.

Having said all that, there are now many alternatives for showing other people your digital photographs that don’t involve trying to send them through the email system, so if you regularly send lots of images it’s worth considering them. These alternatives include posting images on your social media page (eg Facebook), storing them online on Microsoft’s Skydrive system or Kodak’s online photograph album system, or even creating your own photo website.

There are lots of other aspects of digital images that we could look at, so I think we will be returning to this subject before very long.

In the meantime, you can find more information on jpegs here.

© 2011-2017 David Leonard
Computer Support in London
Privacy Policy Suffusion theme by Sayontan Sinha