Adding border to images.

2010-07-18 183 words 1 min read

A very simple script to add border to images :
**
**

*for i in .jpg; do montage -geometry 720×576 -background black -quality 100 $i conv-$i; done


This is one line that you can run the directory containing all your images and all the files with extension of ”jpg” will be assumed to be images and the command run on them to add the border. The border is black in color and quality of the border is 100%.

The magic used here is montage command that is available in package : ImageMagick

If you do not have this package installed and use yum package manager then just run the command:

yum install ImageMagick

There are quite a lot of other options available with montage command that you can see in the man page or with –help

Example:
Original Image:

<a href="http://amit-agarwal.co.in/wordpress/wp-content/uploads/2008/12/dscf5768.jpg"><img class="size-medium wp-image-403" title="My, My wife and Kid" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/dscf5768-300x225.jpg" alt="My, My wife and Kid" width="300" height="225" />

Image with Border:

<a href="http://amit-agarwal.co.in/wordpress/wp-content/uploads/2008/12/bor_dscf5768.jpg"><img class="size-medium wp-image-404" title="My, My wife and Kid with border" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/bor_dscf5768-300x240.jpg" alt="My, My wife and Kid with border" width="300" height="240" />
[ad#ad-1]


author

Authored By Amit Agarwal

Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.

We notice you're using an adblocker. If you like our webite please keep us running by whitelisting this site in your ad blocker. We’re serving quality, related ads only. Thank you!

I've whitelisted your website.

Not now
This website uses cookies to ensure you get the best experience on our website. Learn more Got it