Here's an example:
Before: http://imgur.com/Z6dLcvN.png
After: http://i.imgur.com/l6iBHbu.png
I was able to do this using:
Code: Select all
convert balls_before.png -crop 170x170+57+50 ball1.png
convert balls_before.png -crop 170x170+257+50 ball2.png
convert balls_before.png -crop 170x170+257+235 ball4.png
convert \
-page 487x451+257+50 ball1.png \
-page +257+235 ball2.png \
-page +57+50 ball4.png \
-background white -layers flatten balls_after.png
I was able to use -composite instead of -layers in one line, but my understanding is that -layers would perform better than -composite.
To get -layers working on one line, I tried this (and many, many other things including trying to use -clone), but I can't get anything to work:
Code: Select all
convert \
-page 487x451+257+50 \( balls_before.png -crop 170x170+57+50 \) \
-page +257+235 \( balls_before.png -crop 170x170+257+50 \) \
-page +57+50 \( balls_before.png -crop 170x170+257+235 \) \
-background white -layers flatten balls_after.png
What am I missing? Thanks.