Page 1 of 1

Grayscale and Quantize on PSD generates invalid file

Posted: 2019-06-20T06:52:08-07:00
by usemagi

Code: Select all

var fi2 = new FileInfo(@"....\190132LCZ.psd");
IMagickImage image2 = new MagickImage(fi2);

image2.Resize(new MagickGeometry(-1, 200));
// following 2 lines causes to created invalid image
image2.Grayscale(PixelIntensityMethod.Average);
image2.Quantize(new QuantizeSettings
{
	Colors = 256,
	ColorSpace = ImageMagick.ColorSpace.Gray
});

image2.Depth = 8;
image2.ColorSpace = ColorSpace.Gray;
image2.Format = MagickFormat.Psd;
image2.AutoOrient();

image2.Write(@".......\22222.psd");
This code creates invalid psd that later causes this - https://imagemagick.org/discourse-serve ... 38#p166838

Original file
https://drive.google.com/file/d/1LaKrxc ... sp=sharing

The result file
https://drive.google.com/file/d/1hjtvA7 ... sp=sharing

Magick.net: 7.14