|
|
Subscribe / Log in / New account

JPEG / JFIF

JPEG / JFIF

Posted Jan 16, 2015 11:24 UTC (Fri) by tialaramex (subscriber, #21167)
In reply to: Some unreliable predictions for 2015 by flussence
Parent article: Some unreliable predictions for 2015

Well, the deal is a bit more complicated than you've suggested. You've focused on the IJG's library, but there's much more.

JPEG per se isn't a file format. The committee weren't focused on storing the data from their compression algorithm as files, they were thinking you'd transmit it to somewhere and it'd get decompressed and then used. So the actual international standard is completely mute about files on disk.

Early on people who did think we should store data in files wrote JPEG compressed data to the pseudo-standard TIFF. But TIFF is a complete mess, conceived as the minimal way to store output from a drum or flatbed scanner on a computer and thus permitting absolutely everything but making nothing easy - and its attempt to handle JPEG led to incompatible (literally, as in "I sent you the file" "No, my program says it's corrupt" "OK, try this" "Did you mean for it to be black and white?") implementations. There were then a series of Adobe "technical notes" for TIFF that try to fix things, several times attempting a fresh start with little success.

JFIF is the "real" name for the file format we all use today, and it's basically where the IJG comes into the picture. Instead of TIFF's mess of irrelevant or nonsensical parameters you've got the exact parameters needed for the codec being used, and then you've got all this raw data to pass into the decoder. And there's this handy free library of code to read and write the files, so everybody just uses that.

So initially the IJG are great unifiers - instead of three or four incompatible attempts to store JPEG data in a TIFF you get these smaller and obviously non-TIFF JPG files and either the recipient can read them or they can't, no confusion as to what they mean. But then they proved (and libpng followed them for a while) incapable of grasping what an ABI is.


to post comments

JPEG / JFIF

Posted Jan 16, 2015 12:35 UTC (Fri) by peter-b (guest, #66996) [Link] (2 responses)

In TIFF's defence, I used TIFF files and libtiff extensively during my PhD, since they're the only sane way of storing and communicating remote sensing datasets (complex 32-bit fixed point pixel values on 6 image planes? no problem).

I didn't experience any problems that weren't due to my own incompetence.

JPEG / JFIF

Posted Jan 16, 2015 13:27 UTC (Fri) by rleigh (guest, #14622) [Link]

TIFF is certainly complex, but that's made up for by its unmatched power and sophistication. I've recently been working on TIFF reading/writing of microscopy imaging data, and testing all the different combinations of PhotometricInterpretation with and without LUTs, pixel type and depth (including complex floating point types), orientation, large numbers of channels, all sorts of combinations of tile and strip sizes, bigtiff, etc. It's quite surprising how many programs and graphics libraries get it wrong. The worst I found was the Microsoft TIFF support on Windows, e.g. for thumbnailing and viewing, which was incorrect for most cases, and apparently it's been much improved! Support on FreeBSD and Linux with free software viewers was better, but still not perfect for many cases.

I think this is primarily due to most authors staying well inside the 8-bit grey/RGB "comfort zone". Sometimes this extends to 12/16-bit or maybe float, and not testing with more sophisticated data.

Most of that is simply the author screwing up. For example, when dealing with strips and tiles, it's amazing how many people mess up the image data by failing to deal with the strip/tile overlapping the image bounds when it's not a multiple of the image size, sometimes for particular pixel types e.g. 1 or 2 bit data. Just a simple miscalulation or failure to check particular tiff tags.

I'm not sure what the solution is here. A collection of images which exercise usage of all the baseline tags with all the special cases (and their interactions) would be a good start. I currently generate a test set of around 4000 64×64 TIFF images for the set of tags I care about, but it's still far from comprehensive. I know it works for the most part, but even then it's going to fail for tags I don't currently code for.

JPEG / JFIF

Posted Jan 17, 2015 10:32 UTC (Sat) by tialaramex (subscriber, #21167) [Link]

I am, since the name probably doesn't ring a bell, responsible for GIMP's TIFF loader, and in another previous life as a PhD research student I read and wrote a great many complex tiled TIFFs created by art historians studying/ preserving various great European works.

So, I'm not saying it's garbage because I don't understand how to use it, I'm saying it's garbage because I do understand and I don't sympathise.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds