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

user187711 picture user187711 · Oct 10, 2009 · Viewed 36.9k times · Source

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

Answer

Corne picture Corne · Oct 13, 2009

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);
}