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

02 Feb 2007 Resize of images in a folder with imagemagick

#!/bin/bash
# Hans-Henry Jakobsen
# Script som bl.a resizer bilder og legger de i rett mappe
# NB! ikke bruk originalfil da dette script sletter fila

# Sjekker at mapper eksisterer
if [ ! -d 320 ]
        then
        mkdir 320
fi
if [ ! -d 480 ]
        then
        mkdir 480
fi

for file in  $(ls|grep JPG)
do
        base320=`basename $file .JPG`_Resized_320.png
        base480=`basename $file .JPG`_Resized_480.png

        convert $file -resize 320 $base320
        convert $file -resize 480 $base480

        #320px
        convert $base320 -background black \
        -font Verdana -pointsize 10 -fill black \
        -gravity center -set caption "Copyright \© 2007 Pario.no"  +polaroid \
        320/$base320;

        #480px
        convert $base320 -background black \
        -font Verdana -pointsize 10 -fill black \
        -gravity center -set caption "Copyright \© 2007 Pario.no"  +polaroid \
        480/$base480;

        # Sletter temp filer
        rm $base320
        rm $base480
        # Ikke bruk originalfil da den blir slettet!
        rm ${file}
done

# Ordner rettigheter
chmod g+rw 320/*
chmod g+rw 480/*
chgrp knausen 320 -R
chgrp knausen 480 -R

Tags: , , , , ,

Posted by

27 Jan 2007 Watermark images with imagemagick ++

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

Posted by