JPEG Compression
When saving is not saving
JPEG (also abbreviated jpg) is a standard coding system that was created by the Joint Photographic Experts Group. JPEG files are unique in that they can produce images that can be saved to a very small size onto a disk as a compressed file format. Compression reduces the file information that needs to be saved and therefore reduces the amount of hard memory required to save a file. This makes them valuable for creating very small files suitable for the Internet as well as for sending images as email. They are also what allow the large image files to be stored on your camera image card. However, this compression comes at a price. JPEG files are considered lossy in that jpeg files actually reduce and/or alter the pixel data in order to reduce the file size. Jpeg files will not have the same pixel data as the original when compressed and uncompressed. During the compression process, some data gets thrown away in order to reduce the file size. The more the image is compressed the less original information is saved for rebuilding the image when it is reopened (uncompressed). In order to maintain the data and the image integrity we need to be aware of the consequences of compression as we save our files.
Warning: You will never be able to recover data that is thrown out or altered due to image compression. Always save your original (from camera or other source) images as a Tiff or Photoshop format before compression. The original will have all of the possible image data that the image will ever possess. ANY alteration due to compression can and will diminish the data and therefore the quality of any jpeg or other format saved as a jpeg file. SAVE all compressed jpeg files with a new name so as NOT to write over your full resolution originals.
The pixel data in a jpeg file is actually reduced as the file gets compressed. Images saved as jpeg files are what I call memory mapped. This means that the algorithm saves a script of sorts that remembers the placement of the pixels within a set frame. The algorithm remembers where to place all of the matching pixels so that the image can be rebuilt. The image is actually rebuilt from the script. This means that the file can be saved to a much smaller size than a bitmap image such as a Photoshop or a Tiff file where every pixel is accounted for. A jpeg when saved, remembers a pixels color density and all of the same density pixel locations in the image for each distinct pixel. This makes it more efficient as to file size, as it only needs to save a single pixel for each color density in the image and all of their locations. However, the more compression that occurs the more data that is thrown away or altered. With more and more compression, certain details will begin to deteriorate as the file size is further compressed. Artifacts in the form of misplaced or misrepresented pixels will be visible on close inspection. In many cases, color will also be compromised.
The worst-case scenario would be saving a compressed file and then reopening it, and saving it again as a jpeg. Each time that the file is compressed, decompressed and further compressed will produce a continuous deterioration of the image. However, any deterioration is in most cases unwanted.


When viewed from a distance or as a screen shot, the images above will seem to be the same. However, when viewed at the pixel level, it is very evident that the images have very different pixel characteristics. Setting 12 is the least compressed setting for saving a jpg file in Photoshop and in effect is equal to no compression of the original data. If you study the examples you will see that it has much more information and many more pixel variations in terms of color and other factors than the one which has received the most compression using the 0 setting. Settings in Photoshop are in increments between 0 and 12 with 0 being the most compression.
Note: Any file when opened in Photoshop, becomes a Photoshop format file. Files saved from Photoshop may be saved as other formats including jpeg format. To date, Jpeg files do not support additional channels and can only be saved as a 24 bit, 6 bits per channel, RGB image file. Saving a file from an imaging program such as Photoshop as a standard jpeg will flatten all layers and cancel all alpha channels.
The use of high compression settings (lower number in PSD) will give you images that may actually look OK on a computer screen at a small size. However, the same image when printed will be lacking in detail as well as texture due to missing pixel data and compression artifacts.
If you compare the enlarged images top and bottom or side to side in the gallery, you should be able to detect major differences between the files that have received the least amount of compression (setting 12) and the ones that received a large amount (setting 0).
Ideally, you should save the original jpg files from a camera or other source as a Photoshop or Tiff file and then make jpg file copies that you save under a different name, which are sized and compressed as required for your output. Photoshop and tiff files will keep all of the original pixel data.
While jpeg files have their purpose, they should be thought of as a secondary format that can be useful for certain circumstances. Otherwise, they should be converted to a safe format such as Photoshop or Tiff in order to safely retain and maintain all of the pixel data.
For further reading about JPEG files and how they work, there are a number of excellent posts on the web. Here are a few:
Please read all of my blog posts on Pixiq
- Tagged with:
- artifact
- compression
- detail
- file
- image
- interpolation
- John Neel
- jpeg
- JPG
- pixels
- quality
- resolution
- saving
- size
- texture
Olympus' Micro Four Thirds 75mm prime
Can you fix the focus on a blurry photo after the fact?
The birth of Mirrorless Cameras
The Joy Of Winning A Photo Contest
Choosing your first dSLR camera
New York City can be beautiful!
Choosing the Right Light Stand
Photojojo iPhone Telephoto Lens review — AudioCast
My week with Q
How To Become A Successful Photographer
"When the Wind Stopped" — poem with 4 photos
Creating The New Family Portrait
Tips for Textures
Cast aways - saving those photographic memories
One Man Show: My 25 Years With Digital Photography
Studio, Flash, & Available Light — Three Books Reviewed
Portrait styling: dangerous pairings
Adobe Photoshop CS6 Product Managers Interview Audiocast
A gift of flowers: unfold your senses
On Set of "Love & Robots" the Film
No-Brainer Setup For A Digital Photo Frame Exhibit - Part 3











Planning “National Geographic” style photo travel
Wilderness Travel 1 Rainforests – Essential Gear
Backlighting Basics
What Moves You?
FIGURES IN MOTION: Decades of Evolving Personal Imagery in Photography, Part 7
Lomography Store, Austin, Texas — GALLERY
GALLERY — Up to $1,000 Reward for Cattle Rustlers
25% off on photography eBooks
eyePhone: The eBook for iPhone Photographers
Interview with Harold Davis — Closeup Maestro of Flowers & Water Drops
Interview with Steve Caplin — Photoshop Digital Artist, Commercial Illustrator, & Author
A Brief History Of Light & Photography: Part 3 of 3
A Brief History Of Light & Photography: Part 2 Of 3
Easy technique to select, edit and sequence keywords for web
How much should you charge for a photograph?






































Comments
What about using non- destructive programs like Lightroom?
Compressed jpegs are all the same in that they are lossy! Compression means that at least some data is lost. The way Lightroom deals with jpeg files is a bit different from Photoshop in that you do not save the file as a jpeg. Instead, you export the file to compress it and save it under a new name. The original file from the camera remains intact on your hard drive as a first generation compressed file. This means, that the file remains virtually the same as a jpeg file transferred from the camera and depends on the jpeg resolution that you allowed the camera to create. If you chose to have the camera save a small version jpeg, the compression will have already taken place in the camera and the file is already diminished in size. Jpeg resolution is dependent on many factors. Jpeg is always destructive. The least compressed jpeg would be a first order, straight from the camera file, which is usually referred to as a FINE JPEG on most digital cameras.
What about slide shows, like the popular slide show gadget on this laptop of mine? Frankly, I don't know how they work, but is it reasonable to assume they causing slow degradation of the jpegs they display?
Slideshow applications do not alter the image. Basically, they open the file to a screen resolution for viewing. They do not re-save the file after opening. A slideshow can usually show any bit-mapped image stored on your computer or digital camera. Showing your digital photographs as a slide presentation does not destroy the image.
However, the creation of a slide show by resizing your files to make the slideshow run more efficiently is a destructive process if the original files are not saved as full resolution images or if you save the resized file over the original.
Post new comment