Ghostscript:如何决定将多页 PDF 转换为多个 TIFF 的输出分辨率
我需要从扫描仪的一堆多页 PDF 文件中提取 TIFF 图像。 在扫描过程中我指定了 600dpi 的分辨率。
这是我用来生成 TIFF 图像的代码:
<前><代码>gs -q -dNOPAUSE -sDEVICE=tiffg4 \ -sOutputFile=a_page%02d.tif a.pdf -r600x600 -c 退出这为我提供了正确数量的 TIFF 图像,但是图像尺寸小于我的预期。
无论我如何更改
-r
选项,输出图像都具有相同的大小。这里发生了什么?
输出的 TIFF 图像有一些压缩,我应该如何更改 gs 选项以便它们不包含任何压缩?
http://pages.cs.wisc.edu /~ghost/doc/cvs/Devices.htm#TIFF 有几个选项可供选择,但在我看来,没有人意味着“8 位黑白”+“无压缩”。
有人如何解决这两个问题吗?
I need to extract TIFF images from a bunch of multi-page PDF files from a scanner.
During the scanning I specified a resolution of 600dpi.
Here is the code I used to generate TIFF images:
gs -q -dNOPAUSE -sDEVICE=tiffg4 \ -sOutputFile=a_page%02d.tif a.pdf -r600x600 -c quit
This gave me the correct number of TIFF images, however, the image dimension is smaller than I expected.
No matter how I change the
-r
option, the output images have the same size.What happened here?
The output TIFF images have some compression, how should I change the gs option so that they do NOT contain any compression?
http://pages.cs.wisc.edu/~ghost/doc/cvs/Devices.htm#TIFF
has a few options to select, but seems to me no one means "8-bit Black&White" + "Compression Free".
Does anybody how to solve these two problems?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您使用
tiffg4
进行输出,则您隐含地要求在 PDF 中获取传真 G4 压缩类型。您可以通过使用不同的 TIFF 输出设备来告诉 Ghostscript 不使用压缩,例如 tiffgray(灰色,8 位)、tiff24nc(RGB-TIFF,每个颜色通道 8 位) )、
tiff32nc
(CMYK-TIFF,每个颜色通道 8 位),.... 默认情况下,所有这些输出类型均未压缩。您也可以使用 tiffg4 但删除压缩:
顺便说一句,不存在“8 位黑白”之类的东西。有“1bit黑+白”,但一旦超过1bit,你就会进入灰度领域......:-)
If you use
tiffg4
for output, then you implicitely asked to also get the Fax G4 compression type in the PDF.You can tell Ghostscript to use no compression by using a different TIFF output device, such as
tiffgray
(gray, 8bit),tiff24nc
(RGB-TIFF, 8bit for each color channel),tiff32nc
(CMYK-TIFF, 8bit for each color channel), .... All these output types are uncompressed by default.You can also use
tiffg4
but remove the compression:BTW, there is no such thing as "8bit Black+White". There is "1bit Black+White", but as soon as you go beyond 1bit, you'll enter the realm of grayscales... :-)
试试这个:
-g
用于指定 TIFF 在每个维度中使用的像素的绝对数量。获得正确的分辨率/尺寸就这么多了。Try this:
-g
is for specifying the absolute number of pixels used by the TIFF in each dimension. That much for getting the correct resolution/dimension.