Page 1 of 1

[SOLVED] composite with mask ignores mask on Mac

Posted: 2017-09-20T04:13:00-07:00
by smotesko
Hello

I'm using composite with a B/W mask to compose two images.
On Mac I've got version 7.0.7-1 Q16 x86_64 2017-09-10. On Linux 6.7.7-10 2017-07-31 Q16.
First I've discovered it doesn't work as described in documentation on Mac, then I've checked on Linux and there it works fine.

Code: Select all

composite righthalf.jpg lefthalf.jpg mask.gif Mac.jpg
composite righthalf.jpg lefthalf.jpg mask.gif Linux.jpg
Here are all the image files mentioned:
  • righthalf.jpg
    Image
  • lefthalf.jpg
    Image
  • mask.gif
    Image
  • Mac.jpg
    Image
  • Linux.jpg
    Image

Re: composite with mask ignores mask on Mac

Posted: 2017-09-20T07:08:04-07:00
by GeeMack
smotesko wrote: 2017-09-20T04:13:00-07:00First I've discovered it doesn't work as described in documentation on Mac, then I've checked on Linux and there it works fine.

Code: Select all

composite righthalf.jpg lefthalf.jpg mask.gif Mac.jpg
composite righthalf.jpg lefthalf.jpg mask.gif Linux.jpg
The alpha handling has changed between v6 and v7. Try adding "-alpha set" after "composite".

Code: Select all

composite -alpha set righthalf.jpg lefthalf.jpg mask.gif Mac.jpg

Re: composite with mask ignores mask on Mac

Posted: 2017-09-20T09:07:24-07:00
by fmw42
I would suggest you start using the convert .... -composite syntax rather than composite. Composite is very old syntax and very limited compared to convert. See the difference in syntax at http://www.imagemagick.org/Usage/compose/#compose. The first two input images are swapped in convert syntax. So

Code: Select all

convert lefthalf.jpg righthalf.jpg mask.gif -composite Mac.jpg
Also in IM 7, you must add magick before composite. So it would be

Code: Select all

magick composite righthalf.jpg lefthalf.jpg mask.gif Mac.jpg

Re: composite with mask ignores mask on Mac

Posted: 2017-09-20T12:14:45-07:00
by smotesko
GeeMack wrote: 2017-09-20T07:08:04-07:00 The alpha handling has changed between v6 and v7. Try adding "-alpha set" after "composite".

Code: Select all

composite -alpha set righthalf.jpg lefthalf.jpg mask.gif Mac.jpg
fmw42 wrote: 2017-09-20T09:07:24-07:00 I would suggest you start using the convert .... -composite syntax rather than composite. Composite is very old syntax and very limited compared to convert. See the difference in syntax at http://www.imagemagick.org/Usage/compose/#compose. The first two input images are swapped in convert syntax. So

Code: Select all

convert lefthalf.jpg righthalf.jpg mask.gif -composite Mac.jpg
Thanks! Both these solutions fixed my problem in v.7
I'm going to use `convert -composite` from now on.

Re: [SOLVED] composite with mask ignores mask on Mac

Posted: 2017-09-20T14:51:09-07:00
by fmw42
For IM 7 change convert to magick. Do not use magick convert or convert.