在尝试使用Imagemagick将PDF转换为TIF多页时,页面的某些部分变为黑色。
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我们怎样才能得到正确的转换图像?
发布于 2021-07-01 23:50:16
下面的代码适用于Imagemagick 7.1.0.2 Q16和libtiff 4.1.0。基本上,通过将alpha通道的背景设置为白色并将其关闭来移除alpha通道。
convert -density 300 Sample1.pdf -background white -alpha background -compress Group4 x.tiff

https://stackoverflow.com/questions/68205581
复制相似问题