#!/usr/bin/perl if ($#ARGV<2) { die ("Usage: watermark.pl \"\" \n"); } $text=shift @ARGV; for (@ARGV) { $fname=$_; if (! -f $_) { print "Error: $_ does not exist\n"; next; } $properties=`identify $_`; $properties=~m/(\d+?)x(\d+?)\b/g; $pointsize=$2/50; $x=$1-(264*$pointsize/20); $y=$2-(28*$pointsize/20); system("convert -font helvetica -pointsize $pointsize -fill red -draw \"text $x,$y \\\"$text\\\"\" $fname $fname"); }