Quick and dirty batch script to watermark and add IPTC data to a set of files in the supplied dir to
#!/bin/bash # Copyright Andy Wright - www.litost.org 2006. # You have permission to do what you want with it as long as you don't # blame me if it insults your mother etc. :). # Std disclaimers apply. # Quick and dirty batch script to watermark and add IPTC data to a set of # files in the supplied dir to-Copyright . # Needs: # ImageMagick - http://www.imagemagick.org/ # Exiv2 - http://www.exiv2.org/ CopyrightStr="Copyright String" CreditStr="Credit String" Exiv2=/usr/local/exiv2/bin/exiv2 Composite=/usr/bin/composite CopyrightImg=Copyright.png Quality=96 inDir=$1 [ -z "$inDir" ] && cat < < EOF && exit 1 Add watermark and IPTC data to all the files in-> -Copyright Warning probably only works on relative directories. Usage: $0 EOF outDir=$inDir-Copyright test -d $outDir || mkdir $outDir renice 15 -p $$ for file in $(ls -1 $inDir/*.{jpg,JPG} | sed -e "s/^$inDir\///") do infile=$inDir/$file outfile=$outDir/$file echo "Adding IPTC data to $file" $Exiv2 -M"set Iptc.Application2.Copyright String $CopyrightStr" $infile $Exiv2 -M"set Iptc.Application2.Credit String $CreditStr" $infile $Exiv2 -M"set Iptc.Application2.TransmissionReference String $file" $infile echo "Copyrighting $file" $Composite -quality $Quality -gravity southeast $CopyrightImg $infile $outfile done
Source: http://www.litost.org/copyright.sh.txt
Tags: bash, convert, exiv2, imagemagick, watermark
Posted by Hans-Henry Jakobsen
Script som legger til watermark tekst:
#!/bin/bash
width=`identify -format %w DSC06861.JPG`; \
convert -background '#0008' -fill white -gravity center -size ${width}x90 \
-pointsize 36 \
caption:"Copyright (c) 2007 Pario.no" \
+size DSC06861.JPG +swap -gravity north -composite Output_image_watermarked.jpg
Vis hvilke bildeformater imagemagick støtter:
convert identify -list format
Tags: bash, convert, imagemagick, watermark
Posted by Hans-Henry Jakobsen