by lnbolch » Sat Aug 18, 2007 8:20 pm
It is a good question, because it is so often asked. To answer it, one needs to understand the nature of the file formats.
First, 24-bit images are 8-bits per channel. Red, green and blue are represented by 256 steps of lightness from none at all to total lightness. Now, a lot of processing is done in 48-bit workspace allowing 16-bits per channel. This provides 0 to 65536 steps. At this time in history, though the image may be processed as 16-bits per channel, it can only be viewed as 8-bits per channel in most cases.
TIFF can be compressed a bit when saved, but the savings are generally quite small. When saved, there is no loss of quality, and bit depths beyond 8-bits per channel (24-bits) are supported.
The great strength of JPEG is the flexibility of its compression. This is often controlled by a scale of 1 to 100, but there is no standard. In Photoshop, Save As... gives only 12 steps, while Save For Web... provides the whole 100.
When you save a JPEG some very sophisticated analysis takes place, calculating how to best compress it. At the lowest compression/highest quality, it looks only for redundant information which it discards. When opened again, the JPEG loader in your program is smart enough to understand this and restores everything. At higher levels of compression, it begins to look for clumps of pixels of the same colour, so each clump can be represented by a single set of values. A picture with a large white wall, may be represented by a couple dozen values instead of thousands. Again the loader restores the missing information. At high levels of compression, clumps of pixels will be grouped together, and artifacts may become quite visible. At this point, the loader does its best, filling out every pixel with colour values, but the original quality is forever lost.
So While TIFF is ALWAYS the whole value of the original image, JPEG may or may not be to a continuously varying degree. At maximum quality, JPEG handles lines, type and the like very well. At maximum compression, it really looks aweful. The artifacts of high compression are first seen along contrasty edges. Both TIFF and JPEG handle gradients very well, and at the highest quality setting, JPEG and TIFF images appear identical. Depending upon content, however, the JPEG image file will be considerably smaller. Try it yourself and see.
If one needs both a small file size and clear type and lines, PNG is an excellent choice. Though not widely used, it is widely supported. It has a further advantage of being able to support transparency.
Referring to your final question, when you process in 32-bit, all colour information is actually just 24 bit. You still just have 8-bits per channel, with a red, green, blue and an alpha channel that supports transparency. There is no loss going from 32-bit to a 24-bit file for delivery. The alpha channel is used when compositing images together. Nothing whatever to worry about here.
Going from 16-bits per channel (48-bit) to 8-bits per channel means a whole lot of mathematics, and colour precision is lost through rounding errors as 65536 x 3 steps are reduced to 256 x3 steps. In cases like photographs, this would not be noticed, but in something like a corporate logo where a spot colour is critical, it could well be off just a bit. This is the whole basis of the Pantone colour system where specific colours are absolute.
At this point, there is only one monitor I know of, that attempts to support 48-bit colour directly. Printers might, but then they might not. I do not have to convert to 24-bit when I print my images, but the driver may well do so. Only those who write printer drivers actually know what takes place.
I realize this is a lot of material - bit depths, alpha channels, image compression and so on, but each of these are factors in understanding in order to find the answers to your questions. TIFF is always safe, but uses up a bunch of disk space. JPEG is incredbily versatile, but the process needs to be understood. PNG is an extremely useful and relatively new format, largely aimed at web-work. All the illustrations in the tutorials on my web-site are done with PNG since they contain both lettering and continuous tone information. I also use the transparency channel in PNG to overlay titles over action in my multimedia and movie work. On the PC side, one also sees BMP files with some frequency. They like TIFF are uncompressed, but the format lacks some of TIFF's more exotic features.
Every image processing program handles JPEGs, since there are probably more of them in the world, than all others combined. Whatever program or programs you use, take the time to play around with the various levels and see for yourself where visible quality begins to decline and thus set your own baseline.