DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Imagemagic Quadruplicator

  • submit to reddit
        //basic usage example
#1:makes a copy of the image
convert $1 -negate -flop "1-"$1 
#2: appends the copy to the original
convert $1 "1-"$1 +append out.jpg 
#3 copies the new double image, flips it 
convert out.jpg -flip -flop out1.jpg && convert out.jpg out1.jpg -append out2.jpg
#clean up
rm 1-*
rm {out1,out}.png
mv out2 $1-out.png
#clean way to get filename and extension in bash?