Please help me optimize my convert command string
Posted: 2013-09-25T02:47:36-07:00
Hi,
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:
I tried to write to a mpr instead of a file on disk, because I thought that might speed things up but I couldn't get it to work.
Could someone take a look and give me some advice to optimize the convert command? Thanks!
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!