possible bug verbose stats for -colorspace gray iM 6.4.4.-4

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

possible bug verbose stats for -colorspace gray iM 6.4.4.-4

Post by fmw42 »

IM 6.4..4-4 Q16 Mac OSX Tiger

I may be remembering wrong, but for grayscale images, the histogram, as I recall, seemed to just display min, max, mean and std once only for channel statistics "Gray". Now it seems to display statistics for Red, Green and Blue even when the type is grayscale. Seems like the colorspace is still RGB and not Gray, now, even when specifying -colorspace Gray.

Basically, it seems like -colorspace Gray is not being honored in the verbose info.

Has this changed in 6.4.4.-4 or a recent version? Seems like at one time it was just showing Gray stats?

convert rose: -colorspace gray rose_gray.png
identify -verbose rose_gray.png

...
Base type: Grayscale
Endianess: Undefined
Colorspace: RGB
Depth: 8-bit
Channel depth:
red: 8-bit
green: 8-bit
blue: 8-bit
Channel statistics:
red:
min: 37 (0.145098)
max: 255 (1)
mean: 105.139 (0.41231)
standard deviation: 47.3905 (0.185845)
green:
min: 37 (0.145098)
max: 255 (1)
mean: 105.139 (0.41231)
standard deviation: 47.3905 (0.185845)
blue:
min: 37 (0.145098)
max: 255 (1)
mean: 105.139 (0.41231)
standard deviation: 47.3905 (0.185845)


Likewise:
convert rose: -channel red -separate -colorspace gray rose_red.png
identify -verbose rose_red.png

...
Type: Grayscale
Base type: Grayscale
Endianess: Undefined
Colorspace: RGB
Depth: 8-bit
Channel depth:
red: 8-bit
green: 8-bit
blue: 8-bit
Channel statistics:
red:
min: 35 (0.137255)
max: 255 (1)
mean: 145.712 (0.57142)
standard deviation: 69.2953 (0.271746)
green:
min: 35 (0.137255)
max: 255 (1)
mean: 145.712 (0.57142)
standard deviation: 69.2953 (0.271746)
blue:
min: 35 (0.137255)
max: 255 (1)
mean: 145.712 (0.57142)
standard deviation: 69.2953 (0.271746)


Neither seem to show colorspace as Gray (but as RGB)! Are either of these issues a bug or are they intended changes or am I just not clear what is to be displayed here?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: possible bug verbose stats for -colorspace gray iM 6.4.4.-4

Post by magick »

We have a patch for the problem you reported. It will be available by sometime tomorrow in the Subversion trunk. Thanks.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: possible bug verbose stats for -colorspace gray iM 6.4.4.-4

Post by anthony »

More than likely the PNG image itself is RGB and not gray.
Not certain what the patch 'Magick' is adding will do.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply