Doug Kerr
Well-known member
Warning: Today's theory lecture might possibly have some practical implications on our photographic work.
**********
An 8-bit number has a range of (in decimal) 0-255. Its span, then, is 255 units (2^8-1). A curious implication of this is that, from a number theory standpoint, an 8-bit number represents values to a "precision" (defined with respect to the maximum value) of about 7.989 bits (not 8 bits). [log2(255)=7.989...]
There are innumerable standards, specifications, algorithms, and protocols that have anomalies in then as a result of some quantity being divided or multiplied by 128 when it should have been divided or multiplied by 127, or vice-versa.
Photoshop, in its "16-bit" color space mode, averts this problem by having a range of 0-32768, a span of 32768 units (2^15). It thus represents color coordinates to a precision of exactly 15 bits (not 16 or even close).
One interesting side effect of this is that if we look at an image held in 8-bit RGB form, but ask the Info box to report the color coordinate values on both 8-bit and 16-bit bases, the 16-bit report is always almost exactly 128.5 times the 8-bit report. [32768/255=128.502...]
What then happens if we take an image held in some RGB color space in "16-bit" mode and save it as a 16-bit RGB TIFF file? (In such files, the range of the color coordinates is 0-65535 - 0 to 2^16-1.)
Well, Photoshop will not allow us to save a file in its "16-bit" RGB mode as a 16-bit RGB TIFF file - we can only save it as an 8-bit file (with precision 7.989 bits). That takes care of that!
Suppose we want to take a Photoshop "16-bit" image and write it to a 16-bit RGB TIFF file. Well, we can have Photoshop convert the image to its 32-bit mode (that does not of course increase its precision, which is still 15 bits, but it is now held in 32 bits), and then write that as a 16-bit RGB TIFF file (which Photoshop is willing to do). Of course, the actual precision of the coordinates for the image is still only 15 bits, but that is perhaps better than not quite 8 bits.
Best regards,
Doug
**********
An 8-bit number has a range of (in decimal) 0-255. Its span, then, is 255 units (2^8-1). A curious implication of this is that, from a number theory standpoint, an 8-bit number represents values to a "precision" (defined with respect to the maximum value) of about 7.989 bits (not 8 bits). [log2(255)=7.989...]
There are innumerable standards, specifications, algorithms, and protocols that have anomalies in then as a result of some quantity being divided or multiplied by 128 when it should have been divided or multiplied by 127, or vice-versa.
Photoshop, in its "16-bit" color space mode, averts this problem by having a range of 0-32768, a span of 32768 units (2^15). It thus represents color coordinates to a precision of exactly 15 bits (not 16 or even close).
One interesting side effect of this is that if we look at an image held in 8-bit RGB form, but ask the Info box to report the color coordinate values on both 8-bit and 16-bit bases, the 16-bit report is always almost exactly 128.5 times the 8-bit report. [32768/255=128.502...]
What then happens if we take an image held in some RGB color space in "16-bit" mode and save it as a 16-bit RGB TIFF file? (In such files, the range of the color coordinates is 0-65535 - 0 to 2^16-1.)
Well, Photoshop will not allow us to save a file in its "16-bit" RGB mode as a 16-bit RGB TIFF file - we can only save it as an 8-bit file (with precision 7.989 bits). That takes care of that!
Suppose we want to take a Photoshop "16-bit" image and write it to a 16-bit RGB TIFF file. Well, we can have Photoshop convert the image to its 32-bit mode (that does not of course increase its precision, which is still 15 bits, but it is now held in 32 bits), and then write that as a 16-bit RGB TIFF file (which Photoshop is willing to do). Of course, the actual precision of the coordinates for the image is still only 15 bits, but that is perhaps better than not quite 8 bits.
Best regards,
Doug