Fun stuff. BTDT. Got the T-shirt.
[0] https://www.itu.int/itudoc/itu-t/com16/tiff-fx/docs/tiff6.pd...
Fun stuff. BTDT. Got the T-shirt.
[0] https://www.itu.int/itudoc/itu-t/com16/tiff-fx/docs/tiff6.pd...
Like, DNG files are TIFFs, so now you need a raw camera decoder, which is basically subjective.
See, sometimes people think images start at the top, so the first data at y=0 is at the top of the image, other people think they start at the bottom like a graph you draw in maths, were y=0 is clearly at the bottom of the image.
So TIFF says: That should be a parameter of the image.
Why? Well, TIFF came into existence because of scanners, when scanners were first invented each scanner would have its own data format - you're not going to store all this data because that's expensive - who owns that much tape? But when it's scanned clearly the bits you get have some sort of arrangement, maybe a bright white area is 1 and black is 0, maybe the opposite. That's kind of annoying, lets agree a standard.
OK, so as Scanner Maker A my proposed standard is: Exactly what my popular A9 Scanner does
No! As scanner maker B, clearly the standard should be what our BZ-20 model does
No! Everybody at scanner maker C knows the obvious thing to do is derive the standard from the behaviour of our popular C5 and C10 scanners!
Result: The TIFF standard says all of the above are OK, just add header data explaining what's going on. Since some scanners would scan a page from the top, those say y=0 is at the top, those vendors whose scanner works the other way say y=0 is at the bottom!
Windows BMP (DIB) also has the convention that y=0 is at the bottom. https://en.wikipedia.org/wiki/BMP_file_format
What a huge PItA.
I was young and stupid, back then.
I learned about not biting off more than I could chew. Important lesson in humility.
It's fairly "low-level," so could probably benefit from Façades.
I wonder if grandparent meant something else, but i don't know enough this instant to guess at what other format?
The real kicker is it's not even useful. Just say "unsupported" to everything that isn't a dumb RGB dump and no one will ever notice!
I don't think I ever saw a embedded jpeg.
The writer was so trivial that even with the need to encapsulate the uncompressed data in a Deflate compatible bitstream it was just easier than trying to do a BMP output.
I've even released my code under public domain if someone is interested: http://public-domain.advel.cz/
(And don’t take this as a knock against TIFF in general—as far as I know, it’s one of the few image formats that takes the possibility of large and larger-than-memory images seriously. I think HEIF also does? But ISO paywalled it after first making it publicly available, so, hard pass.)
[1] Here’s a writeup that comes to similar conclusions: https://dpb587.me/entries/tiff-ifd-and-subifd-20240226
Traditional readers saw a JPEG (although an unusually obese one), but our software could access the second entry, which contained the raw source, and the control parameters for all the processing steps that resulted in the JPEG, so we could treat the image as nondestructive, and reversible.
It was never actually released, if I remember, but it may well be patented.
TIFF was originally designed to store drum scanner data, in realtime, so it uses strips, as opposed to tiles.
It was in C++, and I couldn’t do 100%, but I probably got about 80% (but not so performant). The weirdest thing, if I remember correctly, was pixel data with different sizes between stored components.