What’s packing your suitcase got to do with image files? We'll get to that in a minute...
First, lets talk about the three main TYPES of image file formats: "lossy" compressed, "lossless" compressed, and uncompressed. So, what do these terms mean? Well compressed is pretty obvious. It means that the file has been “squished" to reduce its size (smaller file = less storage space = easier to send over the Internet). Lossy simply means that some information was lost in order to reduce the file size. On the other hand, lossless means that nothing was removed - the information was just rearranged to store it more efficiently. An uncompressed image is saved pixel for pixel - nothing lost, nothing rearranged.
The obvious question is what file formats are what type.
Well the most common image file format these days is JPEG (.jpg). The JPEG format is a LOSSY compressed format. However, how much is lost is variable. JPEG files can be saved with different quality (or compression) settings. Adobe Photoshop uses a sliding scale that runs from 1 (very high compression, very low quality) to 12 (minimal compression, very high quality). Most digital cameras also have settings for the level of jpeg compression. To make matters worse, every time you open a lossy compressed file, make some kind of change, and then re-save it, you are re-compressing the data and lose a bit more information.
The most common LOSSLESS compression format on the internet is PNG. However in terms of lossless high resolution image files, Photoshop’s native file format, PSD is used more for high quality printing. These files store the image data in a more efficient manner than a straight pixel-for-pixel format. The size of a PSD file can vary greatly depending on the content of the image. Images with large areas of a single color (white for instance) can be a much smaller file than an image that is more complex. No data is lost, it’s just put together differently.
When we talk of an uncompressed format, we are probably referring to TIFF (.tif). These files store the image data one pixel after another. Not very efficient, but easy to use with just about any image processing software on any platform.
I am excluding RAW files in this post because these are specific camera image file types and generally not used to save or send modified images.
So what about the suitcase?
Well my wife had a great analogy for these file formats. Let’s say your closet full of neatly pressed and organized clothes represents an uncompressed file. Not easy to transport your stuff this way, but everything stays perfect. Continuing the analogy, a LOSSLESS compressed file is represented by taking your clothes and packing them very carefully in hanging bags with everything kept perfectly pressed and neatly folded. Similar items would be “nested” together and would not take up much space. Once you got to your destination and carefully unpacked your bags, everything would be just as it was before you packed, but the hanging bags would be much smaller than the closet.
So by now, you probably guessed that a LOSSY format can be compared to packing in a suitcase. The smaller the suitcase (smaller file), the more you have to jam everything in. Some things get hopelessly wrinkled and perhaps damaged or broken. You might even have to leave a few pieces of clothing out to fit. Additionally the more times you re-pack the suitcase (re-save the file), the more you jam things in and the more you ruin the clothes!
Then why is JPEG so common? In the same way as clothes neatly packed in a LARGE suitcase can be unpacked and look almost as nice as before you packed, a high-quality JPEG file is VERY close to an uncompressed file. However, the JPEG file will be considerably smaller that the uncompressed file (closet vs large suitcase.) But keep in mind that if you keep opening that neat suitcase, take out one shirt from the bottom and then replace it with another shirt, you will start to wrinkle the clothing items around the shirt (opening the file, making a change and then re-saving).
The take-away from this is that JPEG is best used as a transport file format or as a storage format for images that are not going to be altered. Once the image has been transported (i.e. sent via the Internet) and you are going to be working on the image then it should be saved as a PSD or TIFF for editing and repeated saves. If your storage is tight or you are going to need to send the altered image out again, then you can save it as a high quality JPEG as the last step. Keep in mind that if you don’t save a PSD or TIFF, you will loose any layers (and paths and channels and editable type) that you might have created in Photoshop. Always best to keep your master files as PSD or TIFF.
And remember, unless you are extremely limited in storage space or Internet bandwidth, avoid saving your JPEG images using the lower quality, higher compression settings. Otherwise you will be looking at some very wrinkled shirts...