从命令行减少PNG文件的位深度 [英] Reduce bit-depth of PNG files from the command line
问题描述
我可以从CLI中执行哪些命令或一系列命令来递归遍历目录树并将该树中所有PNG文件的位深度从24bpp减小到16bpp?命令应保留Alpha层,并且不应该增加PNG的文件大小-实际上,减小该大小是可取的.
What command or series of commands could I execute from the CLI to recursively traverse a directory tree and reduce the bit-depth of all PNG files within that tree from 24bpp to 16bpp? Commands should preserve the alpha layer and should not increase the file size of the PNGs - in fact a decrease would be preferable.
我可以使用基于OSX的系统,并且熟悉find
命令,因此我真的更热衷于找到合适的PNG实用程序命令.
I have an OSX based system at my disposal and am familiar with the find
command so am really more keen to to locate a suitable PNG utility command.
推荐答案
AFAIK唯一支持alpha图层的PNG格式是PNG-24;将PNG缩小为另一种格式可能需要在CLUT中指定透明颜色,这不会为您提供所需的输出.
AFAIK the only PNG format that supports the alpha layer is PNG-24; Reducing the PNG to another format may require specifying a transparent color in a CLUT, which will not give you the output you want.
从PNG网站的功能列表中:
From the feature list on PNG's website:
- 每个样本8位和16位(即24位和48位)truecolor支持
- 在8位和16位模式下具有完全的alpha透明度,而不仅仅是像GIF这样简单的开关透明度
...我的意思是说,PNG-24或PNG-48以外的任何内容都不支持完整的Alpha透明度.
... which I read to mean that anything other than PNG-24 or PNG-48 does not support full alpha transparency.
这篇关于从命令行减少PNG文件的位深度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!