Bug in -recolor matrix operator IM 6.3.5
Posted: 2007-09-01T05:18:20-07:00
Hello
I have investigated the -recolor operater and found it does not do correct matrix multiplication to the image as expected.
The issue is discussed at length here: viewtopic.php?f=2&t=9140
at the end. viewtopic.php?f=2&t=9140&p=29633&e=29633
It seems the multiplication is done "a row" at a time, carrying the result forward to the next row. Thus if a pixel has the rgb values (8,32,128) the command
Should just rotate the channels (128,8,32). However this is not the case.
First the red channel is dealt with (top row) here the value from the blue channel is copied (128). Then the green channel is treated, but carrying the result from the new red one (128) and finally the blue channel is copied from the new green (128). Final result is (128,128,128).
My version is ImageMagick 6.3.5 08/31/07 Q16 compiled on Ubuntu 7.04
Regards
Lars Termansen
I have investigated the -recolor operater and found it does not do correct matrix multiplication to the image as expected.
The issue is discussed at length here: viewtopic.php?f=2&t=9140
at the end. viewtopic.php?f=2&t=9140&p=29633&e=29633
It seems the multiplication is done "a row" at a time, carrying the result forward to the next row. Thus if a pixel has the rgb values (8,32,128) the command
Code: Select all
convert in.png -recolor \
'0, 0, 1, \
1, 0, 0, \
0, 1, 0' \
out.png
First the red channel is dealt with (top row) here the value from the blue channel is copied (128). Then the green channel is treated, but carrying the result from the new red one (128) and finally the blue channel is copied from the new green (128). Final result is (128,128,128).
My version is ImageMagick 6.3.5 08/31/07 Q16 compiled on Ubuntu 7.04
Regards
Lars Termansen