Page 1 of 1

wrong Depth with png format

Posted: 2016-03-25T14:20:53-07:00
by Flauzer
Hi,
I can't convert a jpg image to png, grayscale and 8 bit depth.

Code: Select all


// read from disk...

image.Format = MagickFormat.Png;
...
image.ColorType = ColorType.Grayscale;
image.Depth = 8;
image.Write(FullPathFile);
The result is always 24 bit depth...
I've lost something? where is my mistake? bug?

It seems this https://www.imagemagick.org/discourse-s ... hp?t=27766

Thanks in advance

EDIT.
workaround: ...change image.Format in MagickFormat.Png8.

Re: wrong Depth with png format

Posted: 2016-03-28T02:50:58-07:00
by dlemstra
Setting image.Format to MagickFormat.Png8 is not a workaround. This is how you tell the png writer that you want an 8 bit image.