TIFF 文件有奇怪的元信息,特别是图像大小

TIFF file has weird meta information specifically in image size

我有一些 tiff 图像文件,在一个 tiff 文件中有多个页面。

我试图通过使用 libtiff 和一些 python 库读取图像元信息来制作分离的图像文件,但是图像大小似乎 很奇怪

以下是使用 tiffinfo 对页面的描述。

TIFF Directory at offset 0x67ca (26570)
  Image Width: 1728 Image Length: 1131
  Resolution: 204, 98 pixels/inch
  Bits/Sample: 1
  Compression Scheme: LZW
  Photometric Interpretation: min-is-white
  FillOrder: lsb-to-msb
  Orientation: row 0 top, col 0 lhs
  Samples/Pixel: 1
  Rows/Strip: 1131
  Planar Configuration: single image plane
  Page Number: 0-8
  ImageDescription: 0512464945

但实际上,如果我用图片查看器(对我来说,我只使用默认 Windows 图片查看器程序)看到这张图片,它的高度比宽度长。

每当我将此图像更改为单独的 TIFF 图像时,它看起来与原始 TIF 文件一样。

但是当我将此图像更改为 PNG 时,它缩小了,看起来尺寸也发生了变化。

无论使用 LZW 或 CCITT 等压缩方法,还是 python OpenCV、pillow、tiffimage 等库,都会出现此问题

为什么会如此不同?以及如何在转换 PNG 格式时调整此图像大小?

由于图像中包含个人信息,样本图像不好,我们深表歉意

Resolution: 204, 98 pixels/inch

这是您需要合并的信息。

Image Width: 1728 Image Length: 1131

>>> 1728 / 204, 1131 / 98
(8.47, 11.54) # inches