【发布时间】:2021-07-01 06:53:53
【问题描述】:
在尝试使用 Imagemagick 将 PDF 转换为 TIF Multipage 时,页面的某些部分变成黑色。
Version: ImageMagick 7.1.0-0 Q16 x86_64 2021-06-13 https://imagemagick.org
Copyright: (C) 1999-2021 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI OpenMP(3.1)
Delegates (built-in): bzlib djvu fontconfig freetype jng jpeg lzma openexr pangocairo png tiff x xml zlib
转换后的文件截图:
使用的命令:
/usr/local/bin/magick convert -debug "Blob" -density 600X600 Sample1.pdf -type Grayscale -compress Group4 -monochrome -quality 100 -depth 1 -units PixelsPerInch -define connected-components:area-threshold=3 -define connected-components:mean-color=true -define connected-components:8 Sample1.tif
我们怎样才能得到正确的转换图像?
【问题讨论】:
-
AFAIK,你的命令的以下所有部分都是不必要的
convert,-debug Blob,-type grayscale,-quality 100,-units PixelsPerInch,-define connected-components*。 -
即使我删除它们,Image 在 linux 环境中仍然会重新调黑。
-
IIRC,最近 IM 中的 TIFF 编码器出现了一个错误,所以可以尝试输出一个 PNG,然后(之后)输出一个 JPEG,看看是否是 TIFF 方面导致了问题。
-
我的要求是将 PDF 转换为具有 Group4 压缩、300 DPI 和黑白图像的 TIFF。如果我使用差异压缩页面变黑。 PNG 和 JPEG 转换工作正常。
标签: imagemagick imagemagick-convert