(At least the documentation seems to imply that.)
If yes, then the implicit bit depth reduction has been changed or broken.
Try this:
Code: Select all
convert xc:"rgb(220,221,220)" xc:"rgb(220,222,220)" xc:"rgb(220,220,219)" -append -colorspace gray test1.bmp
convert test1.bmp test1.txt
0,0: (220,220,220) #DCDCDC gainsboro
0,1: (221,221,221) #DDDDDD rgb(221,221,221)
0,2: (219,219,219) #DBDBDB grey86
The first and third pixel values are wrong (according to the 'Gray' formula here).
But I get the correct values with an explicit '-depth 8':
Code: Select all
convert xc:"rgb(220,221,220)" xc:"rgb(220,222,220)" xc:"rgb(220,220,219)" -append -colorspace gray -depth 8 test2.bmp
convert test2.bmp test2.txt
0,0: (221,221,221) #DDDDDD rgb(221,221,221)
0,1: (221,221,221) #DDDDDD rgb(221,221,221)
0,2: (220,220,220) #DCDCDC gainsboro
I'm using IM v6.6.1-10 Q16, on Windows XP.
So, without the explicit '-depth 8' operation, a value of '219.886' (third pixel here; 16 bit representation: 0xDCBF) gets reduced to 219. Of course this was only an example. The slight errors occur with all sorts of operations. I just found out after some greyscale conversions when the values were lower than expected. All 8bit file formats (as output) like JPG, PNG8, GIF, etc. are affected. You only get 'correct' values by adding '-depth 8'.
I think this was introduced in version 6.6.0-6. Older versions produce a correct output - with and without '-depth 8'.