Problem with Borders ..

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
jpentecost
Posts: 2
Joined: 2011-04-12T01:35:56-07:00
Authentication code: 8675308

Problem with Borders ..

Post 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 ?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Problem with Borders ..

Post 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
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Problem with Borders ..

Post 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
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
jpentecost
Posts: 2
Joined: 2011-04-12T01:35:56-07:00
Authentication code: 8675308

Re: Problem with Borders ..

Post 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 !
Post Reply