Inconsistent behavior for -type, -depth and -colors
Posted: 2010-10-21T11:42:46-07:00
Hi,
I needed a simple thing, to rotate and write some png file in 1-bit depth, it didn't matter what format (gif, png, you name it). As it turned out, it's quite a problem in IM. My first approach was (<input> is 1-bit colormap PNG if it matters):
as PNG nicely support palette-based format. No luck, stored as 8-bit. Second try:
and
Still 8-bit. Desperate try:
Success! After some tests it seems PNG can be stored only as GrayScale when one wants 1-bit depth. Why? Palette-based format is perfectly valid => BUG here!
Another strange behavior:
stores 8-bit as I write above. But
stores 1-bit! Not only it's strange, it's also confusing! Aren't colors and depth redundant parameters? This "trick" seems to work for GIF, too but unfortunately, not for PNG
My version of IM is 6.6.4-10 2010-10-10 Q16 ...
I'd love to see I did something wrong... I tried also +antialias and +dither but no luck either.
I needed a simple thing, to rotate and write some png file in 1-bit depth, it didn't matter what format (gif, png, you name it). As it turned out, it's quite a problem in IM. My first approach was (<input> is 1-bit colormap PNG if it matters):
Code: Select all
convert <input> -type Palette -depth 1 output.png
Code: Select all
convert <input> -type Palette -depth 1 output.gif
Code: Select all
convert <input> -type Palette -depth 1 output.bmp
Code: Select all
convert <input> -type GrayScale -depth 1 output.png
Another strange behavior:
Code: Select all
convert <input> -type Palette -depth 1 output.bmp
Code: Select all
convert <input> -type Palette -depth 1 -colors 2 output.bmp
My version of IM is 6.6.4-10 2010-10-10 Q16 ...
I'd love to see I did something wrong... I tried also +antialias and +dither but no luck either.