Hi everyone,
I want to combine serveral commands to create one Image to get the rigth output I have to compose different images and colorize them In a specific order, I have image a, b, c, d and e and I want to create one image like that:
a.png b.png -composite -gravity center -channel RGB -evaluate multiply 0.9 step1.png
c.png d.png -composite -gravity center -channel RGB -evaluate multiply 0.9 step2.png
step1.png step2.png e.png -composite -gravity center result.png
but in one command like that
((a.png b.png -composite -gravity center -channel RGB -evaluate multiply 0.9) (c.png d.png -composite -gravity center -channel RGB -evaluate multiply 0.9) -composite -gravity center) e.png -composite -gravity center result.png
but with brackets it doesn't work. Is there a way to archieve this or is there another strategy for Example Layers which can be adjust for this purpose?
combine serveral commands
Re: combine serveral commands
You can load all inputs at the begining like this:
From now on, these have index numbers 0,1,2,3 respectively. When you want to work on them in parentheses you need to clone the indexes you want to work on. Like this:
From now on, the output of what we did in those parentheses has index number 5. If you do some more work in parentheses the output from those can be referenced by index numbers 6,7,8...
At the end when you want to output something you can delete all unecessary images in the sequence by using: (or whatever indexes you want to delete)
Let us know how that goes for you
Code: Select all
convert a.png b.png c.png d.png e.png
Code: Select all
convert a.png b.png c.png d.png e.png \( -clone 0,1 -composite -gravity center -channel RGB -evaluate multiply 0.9 \)
At the end when you want to output something you can delete all unecessary images in the sequence by using:
Code: Select all
-delete 0,2,3
Let us know how that goes for you
Last edited by tom_dl on 2016-10-25T06:26:54-07:00, edited 1 time in total.
Re: combine serveral commands
Code: Select all
convert a.png b.png c.png d.png e.png \
\( -clone 0,1 -composite -gravity center -channel RGB -evaluate multiply 0.9 \) \
\( -clone 2,3 -composite -gravity center -channel RGB -evaluate multiply 0.9 \) \
\( -clone 5,6,4 -composite -gravity center \) \
-delete 0-6 output.png
- GeeMack
- Posts: 718
- Joined: 2015-12-01T22:09:46-07:00
- Authentication code: 1151
- Location: Central Illinois, USA
Re: combine serveral commands
Two things I notice about your example. First, you need to put the "-gravity" setting before of the "-composite" where you want it to apply. And second, you still have three images going into the last operation, but "-composite" is only going to work on two of them. You'll have to do that in steps or you'll have to assemble them using "-layers ...".Adrian wrote:Hi everyone,
I want to combine serveral commands to create one Image to get the rigth output I have to compose different images and colorize them In a specific order, I have image a, b, c, d and e and I want to create one image like that:
What tom_dl explained for using parenthesis should help you combine all that into a single command, but you really need to let us know which version of ImageMagick you're using and what platform or shell you're running the command on. Show us complete examples of your commands, and maybe link to some sample images of your input and desired output.
Re: combine serveral commands
Thanks GeeMack - I hadn't checked the rest of the code. Do note that -composite can take three images if the third is a mask.
- GeeMack
- Posts: 718
- Joined: 2015-12-01T22:09:46-07:00
- Authentication code: 1151
- Location: Central Illinois, USA
Re: combine serveral commands
Yep. I was picturing a series of simple overlay composites, but yes, that is correct. There are situations where a third image is used in a "-composite".tom_dl wrote:Do note that -composite can take three images if the third is a mask.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: combine serveral commands
To add to the comments made by others: every "-channel" should have a "+channel", so they bracket the operation(s) that apply to only certain channels. It may not matter in this particular case, but I think it's bad practice to omit "+channel".
snibgo's IM pages: im.snibgo.com