Thursday, October 23, 2008

Photoshop Tutorial- Image File Formats

So you have been playing around with Photoshop. It is kind of fun, your feet are getting a bit wet. Now you want to save what you have done, right? YES! You do. There is something I say a lot:

Save Early, Save Often.

(Edit: Unless you want to write over [and destroy] the original file, then you should think about saving a copy of the file instead of the original. Then the motto would be: Save Early, Save Often, Save a Copy).

It is a creed that everyone should live by. There is no “autosave” protection in Photoshop like you have in MS Word. If the program or computer crashes, you are out of luck.

Which Format?

So which format are you going to save your new masterpiece in? If you have opened up a digital photograph and done basic manipulations to it, then it probably started out as a .jpg (JPEG) and if you hit “Save” then it will probably save as a .jpg.

But is that the right choice? This might seem like an odd question to many people. As you work on most programs, you don’t often have to decide a file format. Well, with images you do if you want to get the most out of your hard work and save it in a way that will suit how you use the file in the future.

When you go to save a file (especially if you choose “Save As…” instead of “Save”), then you are confronted with as many as 20 or more file formats to save in. Some of them are antiquated and irrelevant to most uses. Some of these formats are for backwards compatibility (so you can save in that old format just in case you need to).

For 95% (or more) of you, the following formats are the only ones you really need to know how to use: .jpg (JPEG), .tif (TIFF), .psd (Photoshop Document), .gif, and one of the various RAW formats (.nef, .crw, .cr2, .raf, .mef, .raw, .tif [yes .tif is sometimes a RAW image], .orf, etc.).

JPEG (.jpg)

This format is, by far, the most popular image file format. All digital cameras save in this format, and only more professional (and a few consumer) cameras even give you the option of saving in another format.

The main reason for the popularity of the .jpg file format is because of the format’s ability to have the image go through compression. Compression is a way to make the unwieldy, bulky images much smaller so you can fit many more onto your camera’s storage chip, and onto your hard drive.

The amount of storage space saved is inversely proportional to the quality setting of the JPEG. In other words, if you set the JPEG to save at the highest quality (lowest compression, least loss of detail and data), then it will be a larger file than if you saved at a lower quality setting (more compression and loss of data).

I could get technical and lose you even more than I already have, or I could explain it using an analogy that might help.

JPEG images are like shelf-safe foods, and more specifically like pre-made meals that just need water. A manufacturer has made the food, dehydrated it to a degree, and then it made its way to you. Let’s use soup for this analogy. Taking out the water has made the soup easier to ship and store.

Now compare a dry soup mix (with little dry carrots and peas) to a condensed soup can (with mostly hydrated carrots and peas). Which is better quality when it has been prepared? I don’t know about you, but I prefer the condensed to the dry after they have been re-hydrated. The dry mix was cheaper to ship (due to weight), but so much was taken out of it as it was “compressed,” that it lost a lot of quality.

Now the video will get more technical (with demonstrations) than that, but it is an easy way to think about compression. The computer is removing information. Most of it can be regained (like just adding water), but if you take away too much, there is some detail that is not recoverable. Plus, like dehydrated and canned veggies, the photo can lose some of the original “texture” that it had. The video will explain more on that.

JPEG images can be saved on a quality scale of 1-12. Photoshop rates these as such:

1-4 = Low
5-7 = Medium
8-9 = High
10-12 = Maximum

As discussed, with each level there is a loss of data, but the higher you go the less it is to perceive. At about 9 you find a good file size to quality ratio. If you are most concerned about quality, go for an 11 or so. A 6 or 7 will give you more space savings, but it compressed the file so much that enlarging the image is more difficult.

Bottom Line: Do you want to save in JPEG?

Answer: Yes, it is not bad if you save at a good quality, or for your purposes. Which brings us to the purposes of a .jpg file.

Here are the purposes and situations where JPEGs are or are not suited for:

Digital Camera Capture: GOOD
The JPEG file format is what made digital cameras probable for consumer use. Not everyone could go around with a hard drive tethered to them, and that is what would have had to happen (until recently, when storage cards reached multiple gigabytes) back when cameras started going digital. Just make sure you save at the best quality setting on your camera (unless you are happy with sticking to 4x6 and 5x7 prints) because the lower quality JPEGs don’t enlarge well. You also should save at a high (or the highest) image size.* Why have a 6 mega pixel camera and save the images at 1 mega pixel (and therefore only be able to print 4x6’s)?

*By “size” here I mean actual pixels. Image size is the number of pixels (often rates in mega pixels). File size is how much space it takes on a hard drive.

At lower quality settings and smaller image sizes you are able to put more and more photos on one storage card, but it is at the detriment to your image quality. Test it out and see where your best image quality (and size) to storage space ratio is. It is often around 3/4 of the best quality and size, but everyone’s situation is different, so test it.

Image for the Web: GREAT
JPEG is optimal for the web when dealing with photos. Other file formats are better for illustrations and logos, but for photos, the .jpg is king. Again the whole file size to quality ratio applies. You can always test the results by saving a file, closing it, and then reopening it.

Another thing to think about for the web is image size (again, not file size, but image size – the number of pixels). You want to save the image as small as you can and still have it work for the use it is intended. If you are posting a file to a blog that is just for viewing, and not for you or friends to download and print, then you probably don’t need it much more than 640 x 480 pixels (0.3 mega pixels, or less than a third of a mega pixel). So why waste the time (and online storage space) by uploading a 5 mega pixel (MP) image?

Changing image size is a different tutorial altogether, but it does bring up another creed I live by: Keep an original, Save a copy!

To ensure that you don’t write over (and destroy) the original image with a changed file (and perhaps a web-sized 0.3 MP image that you now no longer have a 5 MP version of), do one of two things:

1) Start with a copied file
2) Save the manipulated image as a new file (choose “Save As…)

Number 1 is more recommended. That way you don’t accidentally write over the original.

Saving a File After Manipulating It: Sometimes GOOD, Sometimes BAD
After you have played around with an image, you can save it back as a .jpg, but that can be both good and bad.

BAD: It is bad when you are going to make more changes later and save it over and over again. Each save compresses it a little bit, and then a little bit more. More quality is lost with each save. Other formats are better for multiple saves: .psd and .tif.

GOOD: If you have made your changes and you are moving on. You don’t plan on making any more changes, then it is a nice way to store the final version in a spzec-saving way. If you want to continue to make changes later, but need a JPEG version now (for the web or printing at your local lab, etc.) then first save in a better format for later manipulation (.psd or .tif). Then you can save a .jpg version for use now.

That about covers it for JPEGs. It is a complicated and popular format, and one that you will run into the most. So it requires the most attention. The other formats won’t be as intensive.



TIFF (.tif)

TIFF is a loss-less file format. No compression is used (unless you do try to compress it in the save-options box, but if you wanted to do that, just use a JPEG). This means it is very high quality and very large.

A 9-quality JPEG from a 12 mega pixel image is between 1.2 – 6.5 MB (the subject matter is vital to compression, the more detail in the image, the larger it is when compressed). The same image as a .tif will be 34.9 MB, always. There is no compression and the quality is unchangeable, so the size of the image is directly proportional to the end file size.

TIFF is great for saving a file, opening it, manipulating it, saving it, opening it, manipulating it, saving it, etc. No detail is lost to compression for every save. So a .tif is recommended for a work in progress.


PSD (.psd)

The Photoshop Document (.psd) file format is the best for a “work in progress.” It is just like a TIFF, only it is native to Photoshop so it has added capabilities that a .tif file doesn’t have.

The major ability it is a bit better at layer saving.

Layers are an advanced Photoshop technique. Layers give you the ability to have layers of photographs or portions of photographs above and under each other. Think of putting a funny hat on the photo of your friend. You would grab a portion of another photo (that contained a hat) and then put it over the photo of your friend.

That portion of a photo is floating over the original photo, and it is in a separate layer. Layers are the key to dynamic editing in Photoshop, and they will be used extensively by me.

JPEGs can NOT be saved with layers. They have to be a flat photo. Period.

TIFFs can be made to save in layers, but they are not as good at it. Here is the difference, using the hat on the friend example.

The hat is a small object over the entire photo. Photoshop sees that small object as being small. It (in essence) saves two photos in one file. The two photos are the large background photo, and the small hat photo. It saves a .psd file that is a little bit larger than the original background photo’s file. So if the background file is 34.9 MB, the .psd file would be around 38 MB because the small photo object (the hat) is only a bit more info. (Note: to achieve this, you must un-check “Maximize Compatibility” as you save a PSD file).

On the other hand, a .tif file would also be saved as two photos in one file, but it would be saved as two complete photos. So if the original was 34.9 MB, the new .tif with two layers would be 69.8 MB. No matter that the second layer is really small, it is a complete new photo layer and is saved as such.

Compuserve GIF (.gif)

The GIF file is rarely used by most Photoshop users, but it is useful so I will mention it.

GIFs are compressed, but not like JPEGs. A .gif is compressed in the number of colors it uses. A JPEG can (and does) use all of the more than 16 million colors that a .tif or .psd image uses. Yes, 16.777 million colors! Having that many possible colors is necessary for an image to look real. Our eyes can see even more colors. But having that many possible colors per pixel is also a main reason digital photos are so big.

A .gif image if for those times you only need between 2 and 256 colors. Think of the ebay logo. It has 9 colors (the video will show that). Why “pay for” colors you won’t ever use? Make an image out of those 9 colors in a format that maximizes that use.

GIFs are therefore optimal for logos and other simple illustrations, especially if they are going on the web.

Well, that covers the most useful file formats. I didn’t think it would be this long, but the good old JPEG is one complicated beast.



RAW

Raw is a format I will only mention, but not delve into. This is because using Raw images is a more advanced way to capture (in the camera) and initially manipulate your images. Only advanced cameras (and a select few "point n' shoot" ones), even allow you to save in Raw.

So what is Raw? Well the short answer is that it is a non-compressed (or very slightly compressed) image format that is 2-5 times larger than a JPEG, and usually smaller than a .tif or .psd (because of the compression). Yet, even with the compression it is (for all intents and purposes) much better than a TIFF as a starting point.

The reason it is better is because of it's bit-depth. Let's not get too technical, and we'll say that an average Raw image has 1,073,741,824 possible colors per pixel (that's 1 billion possible colors) to the normal TIFF and JPEG's 16.8 million colors.

Thos extra shades mean that it can capture subtle (very light or very dark) pixels where a JPEG would see white or black. If you over expose an image, the JPEG will have pure white areas where there should be detail. A Raw image will see subtle detail that you can "pull back" by darkening the image.

I won't even bother with a video for Raw format. That will be a different post altogether, but I'll leave with a video demonstrating how to save in the separate formats.

0 comments: