Tuesday, January 15, 2008

File type choices once the photos are on your computer.

If you read my previous article, you know that one of the advantages of having the camera save your files as .jpg's instead of RAW is the size of .jepg's are much smaller. That comes with the downside of loosing some of the detail that you get with RAW files, though, because jpeg's use what's called "lossy compression". The size difference is substantial because RAW files record exactly what the sensor sees, pixel by pixel, all 8 million of them (on my Canon 30D). Jpeg's take shortcuts by recording blocks of the same or very similar colors together -like instead of "pixel 1, red; pixel 2, red; pixel 3, red" , jpeg's record "pixels 1 through 3, red". Sounds like a good thing, right? But, with 65,000 possible colors that can be recorded, it's likely that even a block of color that looks all red will have slightly different colors pixel-to-pixel. So, jpeg's fudge it a bit. Where RAW would see "pixel 1, red#12,433; pixel 2, red#12,632; pixel 3, red#12, 548", Jpeg might still record it as "pixels 1-3, red#12,548" to save space. Generally there's no problems with this. After all, most of us convert our photos to jpg to upload them to the internet anyway and we could probably never see a difference between a RAW original and a jpeg conversion.

But, you've probably heard horror stories about saving in jpeg format and loosing detail in your photos. It's true that when you save a photo as a jpeg over and over again it'll being loosing detail. That's because each time it says "well, these pixels are close enough to record as the same color" it'll include more and more pixels in that "close enough" category, which means where there were details before, after a lot of re-saving, you'll eventually loose it.

So, how many times can you re-save a .jpeg file? It depends on how many pixels you have to start with. ("Megapixels" describe how many MILLIONS of pixels your camera has.) But, with my 8 Megapixel camera, I often convert my RAW files to jpg, then de-noise and save it as a jpg again, then edit it in Gimp and save it once or twice more. That's up to 4 times for those who are counting and I've yet to see any ill effects, either on-screen at 100% or printed at up to 14x11, so I think some people are a bit over-dramatic about how much you loose. Still, though, if you can save in a "non-lossy" format you should.

Alternatives -I save as .jpg because it's the only way I can retain my EXIF data, but it's definitely recommended that you save as TIFF or .png instead if you can. TIFF is much like RAW -the files are big, but they record everything pixel-by-pixel. On the other hand, .png files are smaller because they record blocks of the same color together to save space just like .jpegs. BUT! unlike .jpg's, they don't loose data by recording blocks of similar colors as "close enough" to be recorded as being the same color

So, to summarize, try to save your photos as .png or as TIFF's while editing, especially if you tend to save and re-save a lot. TIFF's are larger, so you may want to stick with .png's since they have the best of both worlds -they are smaller, but you don't loose any data when saving the file over and over again.


Jpeg myth-busting:
  • Jpeg's do not loose quality each time they are opened. They only loose quality when they are re-saved.
  • Saving a file under a new name each time will not prevent data loss.
  • Saving a file under a new name will not cause data loss on the original file.
  • Renaming a jpeg will not cause data loss.
  • Saving jpeg's at 100% quality does not mean you won't loose any data (or detail), you just won't loose as much.

No comments: