Karl
Karl

Reputation: 51

imageMagick: Using Variable instead of Constant as Parameter in bash script

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

Upvotes: 1

Views: 121

Answers (1)

fmw42
fmw42

Reputation: 53081

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

Upvotes: 1

Related Questions