Page 1 of 1

Problem with Borders ..

Posted: 2011-04-12T03:04:41-07:00
by jpentecost
This is on the command line interface on Linux .. (Ubuntu) and the version is the latest version ..

For this project I have to match a number of still images shot with the Canon 5d with MOV quicktimes also made by the same camera ..

The Mov files have a small border left and right of 7 Pixels and a border at the bottom of 8 pixels

So I made a batch file to ..

mogrify -resize 1906 *.jpg

then crop (to make the image 16x9)

mogrify -crop 1906x1072+0+99 *.jpg

then I put on a border ..

convert *.jpg -bordercolor black 7x8 -gravity center im.JPG

This works fine if there are a small number of jpg's in the folder but if there are 500 then I get an out of memory error ..

I'm obviously telling it to do all the jpegs at once .. how can I get it to do them sequentially ? Or is there a better way to increase the size of the canvas ?

Re: Problem with Borders ..

Posted: 2011-04-12T09:41:00-07:00
by fmw42
You will need to write a script to loop over each image and process it before going to the next one. Or Anthony has recently developed a mogrify type script in Perl to avoid the issue. See http://www.imagemagick.org/Usage/script ... m_pipeline though I am not sure how relevant. Or see http://www.imagemagick.org/Usage/basics/#mogrify_not

Re: Problem with Borders ..

Posted: 2011-04-13T01:14:37-07:00
by anthony
mogrigy can put borders on images.

Its only limitation is that it restricts itself to 'simple image operations' whcih basically means operations that do not require two or more images to do the task. It can generate multiple images but the operator will never merge or re-arrange two or more images.

http://www.imagemagick.org/Usage/basics/#option_simple

Re: Problem with Borders ..

Posted: 2011-04-13T05:14:53-07:00
by jpentecost
Antony .. That is HEROIC .. thanks very much ..

The reason i couldn't get Mogrify to work before was because it was all in the wrong order ..

mogrify -bordercolor black -border 7x8 -gravity center *.jpg

worked for me !