-colorspace no longer working

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.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: -colorspace no longer working

Post by anthony »

Okay. I see...

The save of pure grayscale image is different to one that contains a red dot (to make it non-greyscale).

Yes you are right something is screwy. Hmmm...

Okay. The BUG...
When a pure grayscale image gets saved to MIFF it gets saved with a colorspace "Gray"

Code: Select all

convert Rings1_24b.jpg -colorspace sRGB  -distort resize 100x miff:- | grep --text ^colorspace
colorspace=Gray
but the same image with a spot of color preserves the colorspace correctly!
convert Rings1_24r.jpg -colorspace sRGB -distort resize 100x miff:- | grep --text ^colorspace[/code]
colorspace=sRGB
So in other words MIFF file format is 'loosing' the fact that the image is not just Gray but that the image is linear_gray

In otherwords IM will need either a "sGray" attribute (reversed meaning just as sRGB/RGB is reverse), or should not convert sRGB to Gray when saving to the MIFF. I have made a note about this for IMv7 development.

As a temporary solution (at least for IMv6), this will correct MIFF handling...

Code: Select all

convert Rings1.gif -colorspace sRGB -distort resize 100x -depth 16 rings1_small.miff
convert rings1_small.miff  -set colorspace sRGB -colorspace RGB -depth 8 rings1_small_miff.png
basically it added (set) the information that was 'lost'. Its not particularly nice, but solves the problem.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: -colorspace no longer working

Post by anthony »

A change was made in MIFF coder so that Greyscale will not be used if the image is sRGB. Which will fix the loss of colorspace information problem for the time being in IMv6.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
henrywho
Posts: 188
Joined: 2011-08-17T06:46:40-07:00
Authentication code: 8675308

Re: -colorspace no longer working

Post by henrywho »

Thank you very much for maintaining such a great piece of software.
Post Reply