convert -size 200x30 xc:transparent -font /usr/share/fonts/dejavu/DejaVuSansMono.ttf -fill black -pointsize 12 -draw "text 5,15 'this is just a test'" test.png
Tags: convert, imagemagick, PNG
Posted by Hans-Henry Jakobsen
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
identify -list Type
Tags: identify, imagemagick
Posted by Hans-Henry Jakobsen
identify filnavn.jpg
Resultatet av denne kommandoen er da på formen
JPEG 510×445 510×445+0+0 DirectClass 8-bit 24.8691kb
Tags: identify, imagemagick
Posted by Hans-Henry Jakobsen
#!/bin/bash
# Use a shell loop
#mkdir thumbnails
if [ ! -f *.JPG ] ; then
echo "Ingen filer tilgjengelig!"
else
for file in *.JPG
do
width=`identify -format %w ${file}`; \
convert -background '#0008' -fill white -gravity center -size ${width}x90 \
-font Sketchy -pointsize 50 \
caption:"Copyright © 2007 Pario.no" \
+size ${file} +swap -gravity north -composite thumbnails/${file};
# rm ${file}
done
fi
Tags: bash, convert, identify, imagemagick, JPG
Posted by Hans-Henry Jakobsen