native format - some details, as I know them
John K Jordan
>>The best save is in your editor's native format, whatever
>that might be. Any conversion from the native format,
>which is what the photo is in while it is being edited,
>back to any different photo format will result in distortion/loss...
>
>TIFF conversion retains more data than JPG but its not
>as good as native.
Actually, this is a misconception I’ve seen before but it's not accurate. BTW, my profession is "computer graphics", more or less, at the Oak Ridge National Laboratory in TN (and close to retirement!)
The big difference is between file formats is between those with "LOSSY" compression and those with "LOSSLESS" compression. Formats like TIFF, TGA, PNG, PSD and others are lossless. The common JPEG format is lossy but to confuse things, new standards, i.e. JPEG-2000, do permit lossless compression and some, i.e., JPEG-LS are "lossless/near-lossless", whatever that means.
In a lossess format, pixels are stored without compromise and can be loaded, stored and converted between different lossless formats as often as desired without any loss of data, i.e., image degradation.
Lossy formats, like JPG, throw away data as they compress the file. In a nutshell, they try to determine what things in an images would be missed the least and kick them out. This is what allows a 1 megabyte image to be saved as a 80K file and still be recognizable. Every time a JPG file is saved, the compression algorithm takes a fresh swat at the data and the image is further degraded. The JPG file loading process itself doesn't destroy any ADDITIONAL data, neither does saving as a lossless file format. Editing the the data in a JPG file already loaded doesn't destroy data any more than editing a loaded TIF or PSD file - it's the compression at save time that does the deed. Note that the level of compression (quality setting) you choose at save time can make a huge difference.
The only real difference between the lossless file formats is in the header bits and data organization. You can test this easily – convert a file sequentially to a number of different formats and then back to the original format and do a binary comparison between that file and the original. The native format any graphics program uses comprises a binary header describing how the bytes are stored in the file and a block of code to read and write the data file. Once loaded, any image data is basically stored internally the same way, as a big numerical array. (In my previous career as a hard-core software designer/developer, I sometimes wrote code to store and process image data, for example for machine vision and image analysis systems.)
TIFF files are just as good as any other lossless format regardless of whether the format is native or not to a particular graphic program. However, there is a historical problem with TIFF which may have caused some confusion. TIFF tried to be all things to all people so it was designed to be freely extensible. This lead to many compatibility problems as a variety of “flavors” of TIFF were used by companies and released on the public. For years, I avoided TIFF for this reason. As Photoshop became the standard for professional graphics, TIFF became far more reliable. Note that TIFF is traditionally an uncompressed format but today is commonly used with a lossless compression option. Be aware that there ARE rarely used TIFF lossy compression flavors. TIFF can be used as a “container” for JPG and other compression algorithms. To add to the confusion, TIFF files can be stored in different byte orders which can cause compatibility problems between Mac and Windows platforms. Some programs can save in either format. Here again it Photoshop us useful since it can save or load either format on either platform – we regularly pass TIFF files sized in the hundreds of megabytes between graphic artists without issue. Note that regardless of incompatibilities, a TIFF file can always be loaded back into the same program that saved it. BTW, for my 3D computer animation work I generally use (lossless) compressed TGA files.
BTW, there are a few other deep dark secrets in digital processing and display. One is gamma, the hardware-specific conversion of digital pixels to and from something you can view with your eyes. Gamma determines brightness conversion and by association, color. Some software apps store gamma internally in SOME file formats much to the horror of unsuspecting users. What’s worse, Mac traditionally uses a different monitor display gamma than Windows so some users may see images much lighter. Video (as in tape and DVD) uses a different gamma than a PC monitor. Another HUGE issue is monitor/printer/scanner calibration. If your monitor is not calibrated properly, what you see on your monitor is not what the rest of the world sees, regardless of the care you use in file formats and image processing. But I digress – this is extremely important but getting off the subject.
Digital cameras complicate the image quality issue since most store images in a JPG format. In this case, as John Lucas implied, it is best to load the JPG image into some program and IMMEDIATELY save it as TIFF or some other lossless format. Do your edits, save intermediate and final versions as TIFF or other lossless format (BEFORE resampling/resizing and sharpening!), then convert and save as JPG at the very end. (Right after the final step of sharpening, as Mike pointed out.) Keep the original and final (full size/unsharpened) TIFF files around in case the image needs to be worked on again. The number of versions I keep depends on the projected importance and possible future use and how much work I have in edits!
For better quality, many digital cameras allow you to store images internally as TIFF instead of JPG. This improves quality but at the expense of HUGE file sizes. (Although cards are getting larger and cheaper, how many 18 meg files will fit on one card and how long will they take to download?) Try it to see how many TIFF photos your camera can save on your card. For all but the finest large-scale professional work, I think the TIFF format is unnecessary in the camera. For images primarily intended for display on the web as on WoodCentral, this is really unnecessary, IMHO. For the purist, some cameras also provide a RAW format which can provide better color processing, but at the further expense of a huge amount of hassle. Another story.
For casual work, it is even entirely reasonable to stick with JPG files if you save at the highest quality and don't edit TOO many times. A little hint - when I edit and save a JPG, I append letters on the end of a file name to code the changes: I add "e" for edits, "s" for resizing, "c" for cropping, etc. This makes sure I don't accidentally overwrite the original file with a slip and makes it easy to distinguish between versions on the disks.
The above is a gross simplification of the whole story. But for the casual user, it is safe to freely use TIFF files for archival work. It is also not necessary but safe to use a graphic program's native format, as long as that format is not lossy.
JKJ in East TN
PS: If you have questions about specific file formats from specific programs, I’d gladly run tests and do binary comparisons. (This is the kind of thing I do for fun in my spare time? - ack!) I don’t use GIMP any more, but I could probably load it for testing.
PPS: To open a real can of worms, let's talk about DPI.
PPPS: Sorry for the long post, but to put it in perspective it's only 8K of text data, 1/10th the size of one typical WoodCentral Turning image! :)



