Fernando said:
Kennedy, could you point me to the proper document section? I failed to
find any hint about > 8 bits/channel in the RGB section of the 6.0
paper..
The spec document I have is quite old (June 3 1992) but I believe is
still the most recent publicly available version.
In Section 8, titled "Baseline Field Reference Guide" at the top of page
29, the definition of BitsPerSample is given as:
"Number of bits per component.
Tag = 258 (102.H)
Type = SHORT
N = SamplesPerPixel
Note that this field allows a different number of bits per component for
each component corresponding to a pixel. For example, RGB color data
could use a different number of bits per component for each of the three
color planes. Most RGB files will have the same number of BitsPerSample
for each component. Even in this case, the writer must write all three
values."
On Page 15, under Types, SHORT is defined as a "16-bit (2-byte) unsigned
integer".
So, in theory, the each colour in the tiff format can be as much as
65535 bits - or as many as "1 followed by 19,728 zeros" levels. For an
RGB file that is "1 followed by almost 60thousand zeros" of potentially
different colours. Just a little OTT, no? ;-)
Do you know if the 16-bits data are represented as a whole short
(16-bits) unsigned integer or as two separate bytes,
It is defined as a short unsigned integer, but can obviously be read
from the file as two separate bytes if that is easier in the language
you are using. Providing you get the bytes in the right significant
order, it doesn't make any difference.
and with which byte-wise endianness?
A tiff file uses the same endian structure throughout the file, and this
is defined in the first two bytes of the file:
49h,49h is Ascii for I,I, abbreviating "Intel" who use little-endian
structures.
4dh,4dh is Ascii for M,M, abbreviating "Motorola" who use big-endian
structures.
The best bit is yet to come though! The next byte in a TIFF file is,
according to the specification, "An arbitrary but carefully chosen
number that further identifies the file as a TIFF file."
It is the answer to that ultimate question about life, the universe and
everything. The answer that Deep Thought, the second most powerful
computer in the universe, took seven and a half million years to compute
and the question that the white mice designed built and programmed
planet earth to ask, to which that was the answer: "What does it all add
up to: Life, The Universe and Everything?".
The number is, as every h2g2 listener, reader and/or watcher knows, is..
42 !!!
Douglas Adams lives!
Or at least had some fans at Aldus! ;-)
Seriously though, it is a testament to both the readability, structure
and flexibility of the original specification by Aldus (now Adobe) that
the tiff format remains the most popular non-lossy image file format in
use today, despite being essentially unchanged since its original public
release in 1987. Quite incredible really, given the changes in the
technologies that use it in that time.
The only limitation I think might require update soon is the size limit
of 2^32 bytes in total. With FAT16 and FAT32 filing systems this was OK
since they could only handle similarly maximum file sizes of 4Gb, but
it's getting a bit tight for some large, high resolution, multi-image
files now on NTFS and similar systems.
Well, in a couple years we'll be at the 20th anniversary of "TIFF" - I
wonder if Adobe will update the specification to overcome such
limitations then.
Still, for the moment, I think I'll sit here and enjoy a pan galactic
gargleblaster! ;-)