Search code examples
imageformattiffidentification

How can I know if a TIFF image is in the format CCITT T.6(Group 4)?


How can I know if a TIFF image is in the format CCITT T.6(Group 4)?


Solution

  • You can use this (C#) code example. It returns a value indicating the compression type:

    1: no compression
    2: CCITT Group 3
    3: Facsimile-compatible CCITT Group 3
    4: CCITT Group 4 (T.6)
    5: LZW

    public static int GetCompressionType(Image image)
    {
        int compressionTagIndex = Array.IndexOf(image.PropertyIdList, 0x103);
        PropertyItem compressionTag = image.PropertyItems[compressionTagIndex];
        return BitConverter.ToInt16(compressionTag.Value, 0);
    }