Odd behavior with "-composite" in IM 7.0.3 ?

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
User avatar
GeeMack
Posts: 729
Joined: 2015-12-01T22:09:46-07:00
Authentication code: 1151
Location: Central Illinois, USA

Odd behavior with "-composite" in IM 7.0.3 ?

Post by GeeMack » 2016-10-03T06:59:45-07:00

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?

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

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

Post by snibgo » 2016-10-03T13:54:38-07:00

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.
snibgo's IM pages: im.snibgo.com

User avatar
Marsu42
Posts: 75
Joined: 2014-06-12T03:17:45-07:00
Authentication code: 6789
Location: Berlin

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

Post by Marsu42 » 2016-10-07T03:28:29-07:00

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.

Post Reply