Search code examples
compressiontiffgeotiff

TIFF file - how to decode compression type 3 and 4


I'm writing a tiff decoder and I can't find any technical resources with resources for decoding CCITT Fax Group 3 or 4.

Does anybody have any resources which explain these? The regular TIFF 6.0 document doesn't tell much about decoding. I guess each segment (tile or strip) are encoded independently but that's pretty much the only information I know. I have implemented compression type 2 and is that huffman code tree the same that is used for compression type 3 or 4?

If nobody can find any resources, please post any hints or code or maybe point to an open source library which contains an implementation (most preferably in Java, but any language works). I have looked at the GDAL source code but that file was huge and I would like to see that as an last resort.

Thanks!


Solution

  • I can only point you to the official documents (specifications).

    These documentations aren't available online because the organization that produces them do not allow them to be posted on the internet. You will have to buy these documents from the standards organization.

    As for finding relevant code samples, your best bets are:

    • Libtiff (C library)
    • Libtiff.NET (.NET library)
    • Java Imaging

    A high level overview, without going into the details, can be found on the Wikipedia article

    List of official documentations

    • "T.4 group 3 Fax"
    • "T-REC-T.4-200307-I!!PDF-E.pdf"
    • "T-REC-T.6-198811-I!!PDF-E.pdf"
    • "T-REC-T.563-199610-I!!PDF-E.pdf"
      • 199707, 199710, 199806, 199904