1

I am using the following command sequence (which works pretty well)

convert $PIC -extent ${PIC_PX}x${PIC_PY}+0+0 \
  '(' +clone -alpha transparent -draw 'circle 1920,1080 1920,0' ')' \
  -compose copyopacity -composite circle.png

Now I want to substitute constants by variables

Var1=1920;
Var2=1080;
Var3=1920;
Var4=0

Can you help me with the right notation, please?

Thanks in advance

1
  • The semicolons in your variable assignments are superfluous. Also, always double-quote shell variables that you are expanding, i.e. convert "$PIC" ... and note that the shell reserves variables named in all uppercase letters for its own internal use. Commented Mar 6, 2022 at 21:09

1 Answer 1

1

In Imagemagick 6, that would be the following. But you need to change your single quotes on the -draw arguments to double quotes.

convert $PIC -extent ${PIC_PX}x${PIC_PY}+0+0 \
  '(' +clone -alpha transparent -draw "circle ${Var1},${Var2} ${Var3},0" ')' \
  -compose copyopacity -composite circle.png
Sign up to request clarification or add additional context in comments.

1 Comment

You should also upvote it, btw.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.