resize, add border&watermark

Hello,

Imagemagick is a very powerfull program to modify picture with a simple comand line.
For example, we can write a script to automatically resize, add a border and watermark to many picture in the same directory.


#/bin/sh
for img in `ls *.jpg`
do
convert $img -resize 20% rez_$img
convert -bordercolor "#000000" -border 2x2 -bordercolor "#FFFFFF" -border 4x4 -bordercolor "#000000" -border 2x2 rez_$img border_$img
convert border_$img -font /usr/share/fonts/default/ghostscript/bchri.pfa -fill white -pointsize 16 -draw "gravity southeast text 10,7 '(c) Vargas Emmanuel http://www\
.crapules.com'" final_$img
/bin/rm -f rez_$img
/bin/rm -f border_$img
done

This entry was posted in Linux, Vrac and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>