imagemagick 转换 tiff 会降低质量,如何防止?

imagemagick 转换 tiff 会降低质量,如何防止?

我正在使用 imagemagick convert 从单个 tif 文件中提取多个 tif 图像。但是当我使用以下命令时

convert image.tif single%d.tif

我得到的图像质量很差(有点模糊)。与原始 image.tif 文件中的图像质量相比,文件 等的质量非常差。然后我single1.tif尝试single2.tif

convert -enhance image.tif single%d.tif

但我输出的图像质量仍然很低。

我应该怎么做才能获得多个文件中分离出来的具有原始质量的图像?

附加输出在这里:

convert: image.tif: invalid TIFF directory; tags are not sorted in ascending order. `TIFFReadDirectory'.

convert: image.tif: unknown field with tag 37679 (0x932f) encountered. `TIFFReadDirectory'.
convert: image.tif: unknown field with tag 37680 (0x9330) encountered. `TIFFReadDirectory'.
convert: image.tif: unknown field with tag 37681 (0x9331) encountered. `TIFFReadDirectory'.
convert: Depreciated and troublesome old-style JPEG compression mode, please convert to new-style JPEG compression and notify vendor of writing software. `OJPEGSetupDecode'.
convert: image.tif: invalid TIFF directory; tags are not sorted in ascending order. `TIFFReadDirectory'.
convert: image.tif: unknown field with tag 37679 (0x932f) encountered. `TIFFReadDirectory'.
convert: image.tif: unknown field with tag 37681 (0x9331) encountered. `TIFFReadDirectory'.
convert: Depreciated and troublesome old-style JPEG compression mode, please convert to new-style JPEG compression and notify vendor of writing software. `OJPEGSetupDecode'.
convert: image.tif: invalid TIFF directory; tags are not sorted in ascending order. `TIFFReadDirectory'.
convert: image.tif: unknown field with tag 37679 (0x932f) encountered. `TIFFReadDirectory'.
convert: image.tif: unknown field with tag 37681 (0x9331) encountered. `TIFFReadDirectory'.
convert: Depreciated and troublesome old-style JPEG compression mode, please convert to new-style JPEG compression and notify vendor of writing software. `OJPEGSetupDecode'.
convert: image.tif: invalid TIFF directory; tags are not sorted in ascending order. `TIFFReadDirectory'.
convert: image.tif: unknown field with tag 37679 (0x932f) encountered. `TIFFReadDirectory'.
convert: image.tif: unknown field with tag 37681 (0x9331) encountered. `TIFFReadDirectory'.
convert: Depreciated and troublesome old-style JPEG compression mode, please convert to new-style JPEG compression and notify vendor of writing software. `OJPEGSetupDecode'.
convert: image.tif: invalid TIFF directory; tags are not sorted in ascending order. `TIFFReadDirectory'.
convert: image.tif: unknown field with tag 37679 (0x932f) encountered. `TIFFReadDirectory'.
convert: image.tif: unknown field with tag 37681 (0x9331) encountered. `TIFFReadDirectory'.
convert: Depreciated and troublesome old-style JPEG compression mode, please convert to new-style JPEG compression and notify vendor of writing software. `OJPEGSetupDecode'.
convert: image.tif: invalid TIFF directory; tags are not sorted in ascending order. `TIFFReadDirectory'.
convert: image.tif: unknown field with tag 37679 (0x932f) encountered. `TIFFReadDirectory'.
convert: image.tif: unknown field with tag 37681 (0x9331) encountered. `TIFFReadDirectory'.
convert: Depreciated and troublesome old-style JPEG compression mode, please convert to new-style JPEG compression and notify vendor of writing software. `OJPEGSetupDecode'.
convert: image.tif: invalid TIFF directory; tags are not sorted in ascending order. `TIFFReadDirectory'.
convert: image.tif: unknown field with tag 37679 (0x932f) encountered. `TIFFReadDirectory'.
convert: image.tif: unknown field with tag 37681 (0x9331) encountered. `TIFFReadDirectory'.
convert: Depreciated and troublesome old-style JPEG compression mode, please convert to new-style JPEG compression and notify vendor of writing software. `OJPEGSetupDecode'.
convert: image.tif: invalid TIFF directory; tags are not sorted in ascending order. `TIFFReadDirectory'.
convert: image.tif: unknown field with tag 37679 (0x932f) encountered. `TIFFReadDirectory'.
convert: image.tif: unknown field with tag 37681 (0x9331) encountered. `TIFFReadDirectory'.
convert: Depreciated and troublesome old-style JPEG compression mode, please convert to new-style JPEG compression and notify vendor of writing software. `OJPEGSetupDecode'.

答案1

您可以尝试转换为无损图像类型,而不是输出更多 TIFF 文件。据我所知,ImageMagick 会不惜一切代价避免重新压缩;但由于它发出警告,指出原始文件使用的是旧式压缩(Technote 2 之前的 TIFF Revision 6 JPEG),因此它可能还是会重新压缩它们,从而导致质量下降。

首先尝试无损格式;如果这没有帮助,您可能必须使用不同的库来提取帧。

convert image.tif single%d.png

或者

convert image.tif single%d.bmp

相关内容