Automatically re-size graphics and brand ?

Yuki Cuss celtic at sairyx.org
Tue Jan 24 11:10:27 UTC 2006


Darren Wyn Rees wrote:

>I wonder if the following is possible with Ubuntu.  I'm currently doing
>it laboriously with proprietory software :
>
>Process a collection of photographs in a directory ...
>* Automatically re-size the photographs to a pre-set size
>* Add a 'stamp' or some sort of copyright image on the bottom
>  right corner of the image
>
>Suggestions on what software to look at appreciated.
>
>Darren
>  
>

Okay. Let's say you've got a bunch of JPEGs in your directory. This 
script will resize them all:

[begin script!]

#!/bin/bash

WIDTH=200
HEIGHT=100
STAMP=stamp.png      # note that a transparent PNG will work best ; )

for i in *.jpg
do
    convert -resize `echo $WIDTH`x`echo $HEIGHT` $i `echo -n resized_; 
echo $i`
    composite $STAMP `echo -n resized_; echo $i` `echo -n composed_; 
echo $i`
    rm `echo -n resized_; echo $i`
done

[end script!]

Please note that you need ImageMagick installed (sudo apt-get install 
imagemagick).
This should work, but please test in a restricted environment first to 
make sure it won't ruin anything! You may have to tinker. See `convert 
--help' and `compose --help' for more information!

 - Yuki.




More information about the ubuntu-users mailing list