I'm working on a convert command that takes a random photo, resizes it to a fixed size, creates rounded corners and puts a black background behind it.
The rounded corners part is from the examples from the ImageMagick website. I'm not sure this is the best way to do it, but at least it is all done in one call.
I want the output to be 150 dpi so I put in the resample command. I added the profile 8bim, because I read that this ensures PhotoShop also recognizes the new 150 dpi setting.
I have a working convert string that does what I want, but I was hoping to optimize it for speed and cpu/memory usage.
The convert string I have sofar is:
Code: Select all
convert original.jpg -resample 150 +profile 8bim -thumbnail 827x827 -format 'roundrectangle 1,1 %[fx:w+4],%[fx:h+4] 20,20' -write info:tmp.mvg -alpha set -bordercolor none -border 3 \( +clone -alpha transparent -background none -fill white -stroke none -strokewidth 0 -draw @tmp.mvg \) -compose DstIn -composite \( +clone -alpha transparent -background none -fill none -stroke black -strokewidth 3 -draw @tmp.mvg \) -compose Over -composite -gravity center -background black -extent 1063x1063 output.jpg
Could someone take a look and give me some advice to optimize the convert command? Thanks!