Page 2 of 2

Re: -colorspace no longer working

Posted: 2011-08-18T16:34:48-07:00
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.

Re: -colorspace no longer working

Posted: 2011-08-19T00:20:35-07:00
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.

Re: -colorspace no longer working

Posted: 2011-08-23T00:52:27-07:00
by henrywho
Thank you very much for maintaining such a great piece of software.