[RESOLVED] possible bug -compose difference IM 6.9.10.94 Mac OSX Sierra

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.
Locked
User avatar
fmw42
Posts: 26383
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

[RESOLVED] possible bug -compose difference IM 6.9.10.94 Mac OSX Sierra

Post by fmw42 »

When I separate one channel from each of two images and do a -compose difference -composite, the result is a color image and not grayscale. This only happens with IM 6 (6.9.10.94) and not IM 7 (7.0.9.24)

Input:

Image

Image

Code: Select all

convert \( lena.jpg -channel 2 -separate \)  \( zelda1.jpg -channel 2 -separate \) -compose difference -composite diff6.png

or

convert \( lena.jpg -channel 2 -separate \)  \( zelda1.jpg -channel 2 -separate \) -colorspace gray -compose difference -composite diff6.png
Image


Code: Select all

im7 magick \( lena.jpg -channel 2 -separate \)  \( zelda1.jpg -channel 2 -separate \) -compose difference -composite diff7.png
Image

snibgo
Posts: 13034
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: possible bug -compose difference IM 6.9.10.94 Mac OSX Sierra

Post by snibgo »

In v6, your "-channel 2" needs to be explicitly cancelled before writing the PNG, with "+channel".

Rule of thumb: whenever there is "-channel", also have a "+channel".
snibgo's IM pages: im.snibgo.com

User avatar
fmw42
Posts: 26383
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug -compose difference IM 6.9.10.94 Mac OSX Sierra

Post by fmw42 »

Right. I forgot that.

Locked