msgbartop
A chronological documentation test project, nothing serious, really!
msgbarbottom

30 Sep 2007 Text to image using imagemagick

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: , ,

Posted by

14 Aug 2007 Watermark pictures using exiv2

Quick and dirty batch script to watermark and add IPTC data to a set of files in the supplied dir to -Copyright.

#!/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: , , , ,

Posted by

20 Apr 2007 List fonttypes imagemagick supports

identify -list Type

Tags: ,

Posted by

12 Apr 2007 Get the dimensions of most images from the command line

identify filnavn.jpg

Resultatet av denne kommandoen er da på formen

JPEG 510×445 510×445+0+0 DirectClass 8-bit 24.8691kb

Tags: ,

Posted by

02 Feb 2007 Improved watermark script with imagemagick

#!/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: , , , ,

Posted by