Page 1 of 1

Negate during composite

Posted: 2019-03-07T09:28:46-07:00
by kamil
Hello, I trying learn somethink but i get stuck. Im using Windows cmd and ImageMagick 7.0.8-4 Q16 x64 2018-07-03;
What im trying do is negate black pixel to white during my process, But when im doing this my whole result is negatived.
This is my command

Code: Select all

cmd /c  convert ( "\mockupImages\Backpack_black.jpg" ) ^ "\D0-1999\162 - Alien head (pocket)\-W-.png" -geometry 582.0829986613119x740.4979919678715+989.1880856760375+832.5997322623829  -composite "D:\out.jpg"
How can i only negate -W-.png not whole file.

Re: Negate during composite

Posted: 2019-03-07T10:40:36-07:00
by snibgo
The first pair of parentheses does nothing, and can be removed.

To negate just the second image, put it in parentheses with "-negate":

Code: Select all

cmd /c convert "\mockupImages\Backpack_black.jpg"  ^ ( "\D0-1999\162 - Alien head (pocket)\-W-.png" -negate ) -geometry 582.0829986613119x740.4979919678715+989.1880856760375+832.5997322623829 -composite "D:\out.jpg" 

Re: Negate during composite

Posted: 2019-03-08T02:58:30-07:00
by kamil
it works and not works ;) even if i put "-background none" in ( "W.png" -background none -negate ) result same.
its my design
Image
and this is my result
Image

Re: Negate during composite

Posted: 2019-03-08T06:26:50-07:00
by snibgo
For v7, I suggest you use "magick", not "convert".

You want to restrict the negation to the RGB channels, not alpha, so:

Code: Select all

... -channel RGB -negate +channel ...

Re: Negate during composite

Posted: 2019-03-08T07:28:53-07:00
by kamil
Thank you very for help and share of knowledge :) It works now perfectly.