Grayscale and Quantize on PSD generates invalid file

Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
Post Reply
usemagi
Posts: 12
Joined: 2019-05-21T01:06:38-07:00
Authentication code: 1152

Grayscale and Quantize on PSD generates invalid file

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

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

Post Reply