如何解决使用 Imagemagick 将 PDF 转换为 TIFF,使页面的一部分变成黑色
尝试使用 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
我们怎样才能得到正确的转换图像?
解决方法
以下在带有 libtiff 4.1.0 的 Imagemagick 7.1.0.2 Q16 中对我有用。基本上,通过将其背景设为白色并将其关闭来移除 Alpha 通道。
convert -density 300 Sample1.pdf -background white -alpha background -compress Group4 x.tiff
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。