Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
kamil
Posts: 9 Joined: 2018-04-26T01:26:37-07:00
Authentication code: 1152
Post
by kamil » 2019-03-07T09:28:46-07:00
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.
snibgo
Posts: 12159 Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK
Post
by snibgo » 2019-03-07T10:40:36-07:00
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"
kamil
Posts: 9 Joined: 2018-04-26T01:26:37-07:00
Authentication code: 1152
Post
by kamil » 2019-03-08T02:58:30-07:00
it works and not works
even if i put "-background none" in ( "W.png" -background none -negate ) result same.
its my design
and this is my result
snibgo
Posts: 12159 Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK
Post
by snibgo » 2019-03-08T06:26:50-07:00
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 ...
kamil
Posts: 9 Joined: 2018-04-26T01:26:37-07:00
Authentication code: 1152
Post
by kamil » 2019-03-08T07:28:53-07:00
Thank you very for help and share of knowledge
It works now perfectly.