Bug in -recolor matrix operator IM 6.3.5

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
LarsBT

Bug in -recolor matrix operator IM 6.3.5

Post by LarsBT »

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

Code: Select all

convert in.png -recolor \
       '0, 0, 1,  \
        1, 0, 0,  \
        0, 1, 0'   \
   out.png
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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Bug in -recolor matrix operator IM 6.3.5

Post by magick »

The problem you reported is fixed in ImageMagick 6.3.5-7, the current release. Thanks.
Post Reply