Siddharthan Asokan
Siddharthan Asokan

Reputation: 4441

Nested ImageMagick commands

How would I append the following commands into a single command for ImageMagick?

convert -size 1024x1024 xc:none -draw "roundrectangle 0,0,1024,1024,40,40" png:- | convert AppStore.png -matte - -compose DstIn -composite [email protected]
convert -resize 50% [email protected] [email protected]
convert -resize 50% [email protected] [email protected]
convert -resize 50% [email protected] Logo.png

Upvotes: 1

Views: 332

Answers (1)

Mark Setchell
Mark Setchell

Reputation: 208077

I think you probably want something like this:

convert AppStore.png -matte                                                 \
   \( -size 1024x1024 xc:none -draw "roundrectangle 0,0,1024,1024,40,40" \) \
   -compose DstIn -composite -resize 50% -write MPR:basic                   \
   \( MPR:basic -resize 50% -write [email protected] +delete \)                   \
   \( MPR:basic -resize 25% -write Logo.png    +delete \)                   \
   [email protected]

Or this if you want to avoid the MPR (Memory Program Register):

convert AppStore.png -matte                                                 \
   \( -size 1024x1024 xc:none -draw "roundrectangle 0,0,1024,1024,40,40" \) \
   -compose DstIn -composite -resize 50%                                    \
   \( +clone -resize 50% -write [email protected] +delete \)                      \
   \( +clone -resize 25% -write Logo.png    +delete \)                      \
   [email protected]

Upvotes: 1

Related Questions