Imagemagick/将单色tiff文件转换为单色png文件
我有一个单色的 tiff 文件。它只是黑白像素。
当我使用identify
(imagemagick的一部分)时,我得到以下输出:
filename.tif TIFF 7300x5536 7300x5536+0+0 1-bit Bilevel DirectClass 1.854MB 0.000u 0:00.000
我想将其转换为png文件(以在网络上显示),所以我convert filename.tif文件名。 png
,但是当我识别
这个文件时,我得到:
1577.png PNG 7300x5536 7300x5536+0+0 8-bit PseudoClass 2c 1.669MB 0.000u 0:00.000
即它报告为8位图像(对吗?)
我怎样才能将其强制转换为2位图像?
我的目标是尽可能减少文件大小(不损失质量),并且我认为如果每像素 2 位,它将使用更少的空间。
更新:我已经尝试了以下选项(单独):-深度2
,-colors 2
I have a tiff file that is monochromatic. It's just black and white pixels.
When I use identify
(part of imagemagick) I get this output:
filename.tif TIFF 7300x5536 7300x5536+0+0 1-bit Bilevel DirectClass 1.854MB 0.000u 0:00.000
I want to convert this to a png file (to display on the web), so I do convert filename.tif filename.png
, however when I identify
this file, I get:
1577.png PNG 7300x5536 7300x5536+0+0 8-bit PseudoClass 2c 1.669MB 0.000u 0:00.000
i.e. it reports as 8-bit image (right?)
How can I force this into a 2 bit image?
My goal is to reduce the filesize as much as possible (without losing quality), and i think that if it's 2 bits per pixel, it'll use less space.
Update: I have already tried the following options (on their own): -depth 2
, -colors 2
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许您可以尝试使用:
来自 Imagemagic 文档 ( http://www.imagemagick .org/script/command-line-options.php#colors )
Maybe you can try with:
From Imagemagic documentation ( http://www.imagemagick.org/script/command-line-options.php#colors )