A chronological documentation test project, nothing serious, really!

14 Apr 2008 Create a photo collage using imagemagick

I use imagemagick to create index images to my photo albums to get a quick overview without looking through all the pictures.

This is how I create a simple photo collage using imagemagicks montage command

montage -label '%t\n%wx%h' -resize 150x150 '*.JPG' -geometry +3+3 -tile 3x -frame 5 _Index.JPG

Tags: ,

Posted by

02 Feb 2008 Extracting images from Adobe Acrobat PDF file

This is a short example of how to extract images from a PDF file using ImageMagick

# convert thePDFfile.pdf page-%03d.png
# ls page*
page-000.png  page-001.png  page-002.png

Imagemagick can also be used to create Adobe Acrobat PDF documents

convert DSC* resultFile.pdf

The resultfile contains one image per page.

Tags: , ,

Posted by

30 Dec 2007 Resize and watermark images using Imagemagick

Tina resizedThis is a modified version of my Resize of images in a folder with imagemagick post back in February. Only difference this time is that i strips out EXIF tags and the script has been cleaned up a bit. Click on the image to see the result in full size.


# Description:
# Script to resize JPG images to desired width defined in IMAGESIZE variable.
# EXIF tags is also removed from the result images.
# Software needed:
# jhead -
# imagemagick -

IMAGESIZE="320 480"
for IMAGEFILE in $(ls|grep JPG)
        for I in $IMAGESIZE
                # create directories if needed
                if [ ! -d $I ]
                        mkdir $I

                # Strip EXIF tag information from source file
                jhead -purejpg $IMAGEFILE

                # Resize file
                base=`basename $IMAGEFILE .JPG`_Resized_$I.JPG
                convert $IMAGEFILE -resize $I $base

                # Watermark the file
                width=`identify -format %w $base`
                convert -background '#0008' -fill white -gravity center -size ${width}x15 \
                -font Verdana -pointsize 10 \
                caption:"Copyright © 2007" \
                +size $base +swap -gravity south -composite $I/$base;

                # delete resized file
                rm $base

        # Delete source file (DO NOT USE YOUR ORIGINAL FILE!)
        rm $IMAGEFILE

You can download my resize, watermark bash script here.

Tags: , , ,

Posted by

25 Nov 2007 Great collection of advanced Imagemagick scripts

Today I stumbled upon Fred’s Imagemagick Scripts, a nice collection of bash scripts to do image manipulations like

  • 3D rotate
  • change/enhance brightness
  • Superimposes a set of horizontal and/or vertical grid lines on an image
  • etc…

    Tags: ,

    Posted by

    25 Nov 2007 Create a photo montage using imagemagick

    This is a little bash script I put together to create a photo montage with 5 resized pitures in max 3 rows using imagemagick. The script is run from within the folder I have filled with the JPG images I want to create a montage from.

    #!/bin/bashfor image in `ls *.JPG`  do    convert -resize 50x50! $image small-$image  donemontage small-*.JPG -mode Concatenate -tile 5x3 montage_final.jpg

    The result file like the one below is saved with the filename montage_final.jpg.
    Montage finalOne disadvantage using this technique is that it doesn’t keep the aspect ratio of the pictures.
    You find more examples of montage usage by visiting the ImageMagick v6 Examples — Montage, Arrays of Images page.

    Tags: , , , ,

    Posted by