possible bug RGB colorspace IM 6.8.5.4 Q16 Mac OSX

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 RGB colorspace IM 6.8.5.4 Q16 Mac OSX

Post by fmw42 »

This is very strange. When I convert to -colorspace RGB following -extent, the result is still colorspace sRGB with gamma=1 and not colorspace RGB. It happens with png, jpg and gif

convert rose: rose.png

Image: rose.png
Class: DirectClass
Colorspace: sRGB
Type: TrueColor
Depth: 8-bit
Alpha: False
Channels: srgb
Rendering intent: Perceptual
Gamma: 0.45455

convert rose.png -strip -background "rgb(112,106,106)" -extent 200x200 -colorspace RGB rose_ext_rgb.png


Image: rose_ext_rgb.png
Class: DirectClass
Colorspace: sRGB
Type: TrueColor
Depth: 8-bit
Alpha: False
Channels: srgb
Rendering intent: Perceptual
Gamma: 1
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: possible bug RGB colorspace IM 6.8.5.4 Q16 Mac OSX

Post by magick »

Likely a PNG bug, we'll alert Glenn.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug RGB colorspace IM 6.8.5.4 Q16 Mac OSX

Post by fmw42 »

magick wrote:Likely a PNG bug, we'll alert Glenn.
No. It gets the same wrong colorspace even when using jpg or gif. And in fact, does not convert to RGB or show gamma=1

convert rose: rose.jpg
Image: rose.jpg
Class: DirectClass
Colorspace: sRGB
Type: TrueColor
Depth: 8-bit
Alpha: False
Channels: srgb
Rendering intent: Perceptual
Gamma: 0.454545

Wrong output colorspace and gamma:
convert rose.jpg -strip -background "rgb(112,106,106)" -extent 200x200 -colorspace RGB rose_ext_rgb.jpg
Image: rose_ext_rgb.jpg
Class: DirectClass
Colorspace: sRGB
Type: TrueColor
Depth: 8-bit
Alpha: False
Channels: srgb
Rendering intent: Perceptual
Gamma: 0.454545


And if saved to PNG, it still has the wrong colorspace but has the correct gamma.
convert rose.jpg -strip -background "rgb(112,106,106)" -extent 200x200 -colorspace RGB rose_ext_rgb.png
Image: rose_ext_rgb.png
Class: DirectClass
Colorspace: sRGB
Type: TrueColor
Depth: 8-bit
Alpha: False
Channels: srgb
Rendering intent: Perceptual
Gamma: 1
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: possible bug RGB colorspace IM 6.8.5.4 Q16 Mac OSX

Post by glennrp »

magick wrote:Likely a PNG bug, we'll alert Glenn.
Problem is that the PNG encoder uses the presence of rendering_intent to decide whether to write the sRGB chunk or not. I'll try to fix that.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug RGB colorspace IM 6.8.5.4 Q16 Mac OSX

Post by fmw42 »

glennrp wrote:
magick wrote:Likely a PNG bug, we'll alert Glenn.
Problem is that the PNG encoder uses the presence of rendering_intent to decide whether to write the sRGB chunk or not. I'll try to fix that.

That may fix the write to PNG, but it does not fix the example above that starts with jpg and writes to jpg. It never gets converted to linear RGB. It still shows sRGB and gamma=0.4545 rather than RGB and gamma=1
Post Reply