Grayscale JPG colortype

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
superstator
Posts: 17
Joined: 2017-12-08T10:44:16-07:00
Authentication code: 1152

Grayscale JPG colortype

Post by superstator » 2019-08-26T16:58:22-07:00

I am using Magick.NET Q8 to work with a variety of images from .NET, and I've noticed that when loading an 8-bit grayscale JPG it reports the ColorType as Palette, with a ColormapSize of 256. To the best of my knowledge, JPEG doesn't support any palette color, and 8-bit grayscale really is stored as a single-channel image - technically just the Y component of YCbCr. Given that, shouldn't a grayscale loaded from a .jpg file report a ColorType == ColorType.Grayscale, and ColormapSize == -1? Is this an ImageMagick thing or a Magick.NET thing? Or am I just misunderstanding something?

snibgo
Posts: 12434
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Grayscale JPG colortype

Post by snibgo » 2019-08-26T17:48:21-07:00

superstator wrote:... when loading an 8-bit grayscale JPG it reports the ColorType as Palette, ...
IM is reporting how the image is stored in memory, after the file has been read. In general this may be different to how the data was stored in the file.
snibgo's IM pages: im.snibgo.com

Post Reply