clhsieh wrote:glennrp wrote:glennrp wrote:The simplest solution for you is probably to always write 16-bit RGBA.
Beginning with ImageMagick-6.8.2-0 (SVN revision 10809), the PNG48 and PNG64 output sub-formats
will be available, for writing 16-bit RGB and 16-bit RGBA, respectively. I plan to implement PNG00
as well, which will mean to inherit the color-type and bit-depth from the input
PNG image.
Thanks, I think PNG00 is really what I need, is this only works when input is
png?
Correct. The decoder and the encoder have to cooperate for PNG00 to work. Other decoders
don't store a color-type. Most store a depth, normally 8 or 16, which the
PNG encoder will
recognize. Please note that if you rescale an 8-bit image, that operation might create
16-bit pixels due to interpolation of colors, which increases the depth to 16. Using the
-depth 8 option will prevent (or undo) that. The
PNG color-type is meaningless to other
decoders, so they can't store an input color-type.
The PNG00 "format" is also available as of ImageMagick-6.8.2-0.