注:TIFF将一幅图像划分成几条,每条包含几行,所以Tag提到的图像都用strip。
一、黑白图像的IFD必须有的Tag
Tag 代码 | Tag 名称 | 类型 | 值 |
100 | ImageWidth(图像宽) | SHORT or LONG |
|
101 | ImageLength(图像高) | SHORT or LONG |
|
103 | Compression(压缩) | SHORT | 1-不压缩、2-CCITT压缩、32773-PackBits压缩 |
106 | PhotometricInterpretation (图像类型) | SHORT | 0-黑白,0代表白;1-黑白,0代表黑 |
111 | StripOffsets(图像条的偏移地址) | SHORT or LONG |
|
116 | RowsPerStrip(每条图像包含的行数) | SHORT or LONG |
|
117 | StripByteCounts(条图像的字节数) | SHORT or LONG |
|
11A | XResolution(水平分辨率) | RATIONAL |
|
11B | YResolution(垂直分辨率) | RATIONAL |
|
128 | ResolutionUnit(分辨率的单位) | SHORT | 1-无单位;2-英寸;3-厘米 |
二、灰度图像的IFD必须有的Tag
Tag 代码 | Tag 名称 | 类型 | 值 |
100 | ImageWidth(图像宽) | SHORT or LONG |
|
101 | ImageLength(图像高) | SHORT or LONG |
|
102 | BitsPerSample | SHORT | 灰阶=4或8bits(比黑白图像多出的Tag) |
103 | Compression(压缩) | SHORT | 1-不压缩、32773-PackBits压缩(没有CCITT压缩) |
106 | PhotometricInterpretation (图像类型) | SHORT | 0-黑白,0代表白;1-黑白,0代表黑 |
111 | StripOffsets(图像条的偏移地址) | SHORT or LONG |
|
116 | RowsPerStrip(每条图像包含的行数) | SHORT or LONG |
|
117 | StripByteCounts(条图像的字节数) | SHORT or LONG |
|
11A | XResolution(水平分辨率) | RATIONAL |
|
11B | YResolution(垂直分辨率) | RATIONAL |
|
128 | ResolutionUnit(分辨率的单位) | SHORT | 1-无单位;2-英寸;3-厘米 |
三、索引颜色图像的IFD必须有的Tag
Tag 代码 | Tag 名称 | 类型 | 值 |
100 | ImageWidth(图像宽) | SHORT or LONG |
|
101 | ImageLength(图像高) | SHORT or LONG |
|
102 | BitsPerSample | SHORT | 灰阶=4或8bits(比黑白图像多出的Tag) |
103 | Compression(压缩) | SHORT | 1-不压缩、32773-PackBits压缩(没有CCITT压缩) |
106 | PhotometricInterpretation (图像类型) | SHORT | 3-代表索引颜色 |
111 | StripOffsets(图像条的偏移地址) | SHORT or LONG |
|
116 | RowsPerStrip(每条图像包含的行数) | SHORT or LONG |
|
117 | StripByteCounts(条图像的字节数) | SHORT or LONG |
|
11A | XResolution(水平分辨率) | RATIONAL |
|
11B | YResolution(垂直分辨率) | RATIONAL |
|
128 | ResolutionUnit(分辨率的单位) | SHORT | 1-无单位;2-英寸;3-厘米 |
140 | ColorMap(索引颜色的数据) | SHORT |
四、RGB颜色图像的IFD必须有的Tag
Tag 代码 | Tag 名称 | 类型 | 值 |
100 | ImageWidth(图像宽) | SHORT or LONG |
|
101 | ImageLength(图像高) | SHORT or LONG |
|
102 | BitsPerSample(表示每个要素的bit) | SHORT | 因为受SamplesPerPixel影响,字节大于4,所以此处保存的是值的偏移地址。一般取值得:8.8.8或8.8.8.8 |
115 | SamplesPerPixel(每个像素的颜色要素) | SHORT | 3or4or其他(RGB代表3个samples;CMYK代表4个samples;RGBA代表4个samples) |
103 | Compression(压缩) | SHORT | 1-不压缩、32773-PackBits压缩(没有CCITT压缩) |
106 | PhotometricInterpretation (图像类型) | SHORT | 2-代表RGB颜色 |
111 | StripOffsets(图像条的偏移地址) | SHORT or LONG |
|
116 | RowsPerStrip(每条图像包含的行数) | SHORT or LONG |
|
117 | StripByteCounts(条图像的字节数) | SHORT or LONG |
|
11A | XResolution(水平分辨率) | RATIONAL |
|
11B | YResolution(垂直分辨率) | RATIONAL |
|
128 | ResolutionUnit(分辨率的单位) | SHORT | 1-无单位;2-英寸;3-厘米 |