home tags about

Automated Photo Borders

Posted on: 15 July 2008 in code, ruby, imagemagick, photos, border

If you've ever wanted to automatically add a coloured border to an image, then this ruby script might come in handy.

add_border.rb does exactly what you expect; it adds a border. You can specify the outer and inner sizes, and the colour of the inner border between. By default, this colour will be the average RBG value, giving you an awesome look by default.

To use it, just run ruby ./add_border.rb, or chmod +x it, and run ./add_border.rb. Available arguments are:

The script will output files whose names are the same, but with _border added before the filetype suffix, so that my_image.jpg would become my_image_border.jpg.

You can get it from:

add_border.rb requires RMagick.

Note: I lost the original description page when I nuked my site. So this is a new one.

Comments

Fork me on GitHub