Page 1 of 1

Odd behavior with "-composite" in IM 7.0.3 ?

Posted: 2016-10-03T06:59:45-07:00
by GeeMack
I'm using "ImageMagick 7.0.3-2 Q16 x64 2016-10-02" on "Windows 10 64". Following up on a discussion in THIS thread, in my current version and a couple other recent versions, the "-composite" operation does not always behave as I might expect. If I run a simple command to create a transparent canvas, then a gradient canvas, then composite that gradient onto the transparent like this...

Code: Select all

magick -size 360x360 xc:none -size 240x240 gradient:red-blue -composite test_A.png
... I would expect the result to be a 240x240 gradient placed in the upper left corner of a 360x360 transparent image. What I actually get is just a 360x360 entirely transparent image with no visible overlay at all.

If I add "-alpha on" after creating the gradient canvas like this...

Code: Select all

magick -size 360x360 xc:none -size 240x240 gradient:red-blue -alpha on -composite test_B.png
... the gradient appears in the upper left corner, the result I would have expected from the first command. It doesn't seem like adding "-alpha on" should be necessary to get the composite to work.

Is this something that requires the attention of the developers, or am I overlooking something?

Re: Odd behavior with "-composite" in IM 7.0.3 ?

Posted: 2016-10-03T13:54:38-07:00
by snibgo
In v7.0.2-5, your first command gives the result I would hope for, "a 240x240 gradient placed in the upper left corner of a 360x360 transparent image."

The requirement for "-alpha on" after "xc:none" seems to be a new bug/feature introduced since 7.0.2-5.

Re: Odd behavior with "-composite" in IM 7.0.3 ?

Posted: 2016-10-07T03:28:29-07:00
by Marsu42
snibgo wrote:The requirement for "-alpha on" after "xc:none" seems to be a new bug/feature introduced since 7.0.2-5.
Thanks for crossposting to the bugs subforum, as a mere user it's difficult to figure out if it's a bug or one is merely not using im correctly. Even if this change *would* make sense, it shouldn't occur without longer deprecation and notification of users.