how i could combine this two command into one ?

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?".
Post Reply
diegomage
Posts: 205
Joined: 2017-03-08T10:12:28-07:00
Authentication code: 1151

how i could combine this two command into one ?

Post by diegomage »

im trying to combine this two command into one but i dont know
for generate one image instead of two image result

Code: Select all

convert fragresultc.png  -fill white   +opaque "$zv"  -negate  resuxxlt.png 
  convert  image2.png  -mask resuxxlt.png         -fill white   +opaque white +mask rose_blue.png

please help me
User avatar
GeeMack
Posts: 718
Joined: 2015-12-01T22:09:46-07:00
Authentication code: 1151
Location: Central Illinois, USA

Re: how i could combine this two command into one ?

Post by GeeMack »

diegomage wrote: 2019-04-30T11:31:49-07:00im trying to combine this two command into one but i dont know for generate one image instead of two image result

Code: Select all

convert fragresultc.png  -fill white   +opaque "$zv"  -negate  resuxxlt.png 
  convert  image2.png  -mask resuxxlt.png         -fill white   +opaque white +mask rose_blue.png
At the place in the command where you save the first image to a file, you can write it to an ImageMagick memory register instead. Do that with "-write mpr:result". Then when you need it later in the command you bring it back in by the name of that MPR. Here's the general idea in *nix syntax...

Code: Select all

convert fragresultc.png -fill white +opaque "$zv" -negate \
   -write mpr:result +delete image2.png -mask mpr:result \
   -fill white +opaque white +mask rose_blue.png
After you write that first image to the MPR, it's in a memory location that exists only for the duration of the command. That way you can delete it from the ongoing command until you need it again. Then call it back in with "mpr:result" and continue just as if you're into the second command.

The MPR can have any name you want to give it like "mpr:stage1" or "mpr:opaque" or whatever. You can even write to and recall several MPR images within a single command.
diegomage
Posts: 205
Joined: 2017-03-08T10:12:28-07:00
Authentication code: 1151

Re: how i could combine this two command into one ?

Post by diegomage »

works perfect , very thankyou for your help
Post Reply