-border switch changes colors of whole image
Posted: 2009-09-09T14:54:10-07:00
When operating on an image sequence, and adding a border to the last image of the sequence, the -border switch randomly changes colors of that image, if certain preconditions are met.
Strongly simplified example:
convert logo: ( -clone 0 -bordercolor green -border 10x10 ) +append test.png
This is the expected result.
As far as i understand, the operation
( +clone +clone -compose subtract -composite +delete )
may be pointless, but should not change the result.
The last image in the stack is cloned twice, both copies are combined in one composite, and this composite is deleted, resulting in no new image on the stack
However:
convert logo: ( +clone +clone -compose subtract -composite +delete ) ( -clone 0 -bordercolor green -border 10x10 ) +append test.png
Why do the colors change?
The exact result depends on the last -compose operation:
convert logo: ( +clone +clone -compose multiply -composite +delete ) ( -clone 0 -bordercolor green -border 10x10 ) +append test.png
Update: -respect-parenthesis prevents this weird behaviour, so I am not sure if it is a bug after all.
Strongly simplified example:
convert logo: ( -clone 0 -bordercolor green -border 10x10 ) +append test.png
This is the expected result.
As far as i understand, the operation
( +clone +clone -compose subtract -composite +delete )
may be pointless, but should not change the result.
The last image in the stack is cloned twice, both copies are combined in one composite, and this composite is deleted, resulting in no new image on the stack
However:
convert logo: ( +clone +clone -compose subtract -composite +delete ) ( -clone 0 -bordercolor green -border 10x10 ) +append test.png
Why do the colors change?
The exact result depends on the last -compose operation:
convert logo: ( +clone +clone -compose multiply -composite +delete ) ( -clone 0 -bordercolor green -border 10x10 ) +append test.png
Update: -respect-parenthesis prevents this weird behaviour, so I am not sure if it is a bug after all.