how to composite them in one command?

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
blackgun

how to composite them in one command?

Post by blackgun »

Hi,
I searched the forum and did not find the answer.

Now, I make a image like this by 3 steps
Image

1. text mask
convert -size 300x60 -background none -fill black \
-font './impact.TTF' -pointsize 72 label:'This is a Mask' mask1.png

2. ellipse
convert -size 300x60 xc:skyblue -fill red -stroke black -draw "ellipse 150,30 100,30 0,360" draw_ellipse.png

3. composite
composite -compose Dst_In -gravity center mask1.png draw_ellipse.png compose_mask.png

How can I do this by one command?
Thanks
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: how to composite them in one command?

Post by el_supremo »

This will do it:

Code: Select all

convert -compose Dst_In -gravity center -size 300x60 xc:skyblue \
	-fill red -stroke black -draw "ellipse 150,30 100,30 0,360" \
	( -size 300x60 -background none -fill black -font './impact.TTF'  \
	-pointsize 72 label:'This is a Mask' ) -composite compose_mask.png
Pete
blackgun

Re: how to composite them in one command?

Post by blackgun »

Great ! It works!
Thank Pete :D
Post Reply