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: imagemagick, montage
Posted by Hans-Henry Jakobsen
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: convert, imagemagick, pdf
Posted by Hans-Henry Jakobsen
This 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.
#!/bin/bash
# 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 - http://www.sentex.net/~mwandel/jhead/
# imagemagick - http://www.imagemagick.org
IMAGESIZE="320 480"
for IMAGEFILE in $(ls|grep JPG)
do
for I in $IMAGESIZE
do
# create directories if needed
if [ ! -d $I ]
then
mkdir $I
fi
# 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 Pario.no" \
+size $base +swap -gravity south -composite $I/$base;
# delete resized file
rm $base
done
# Delete source file (DO NOT USE YOUR ORIGINAL FILE!)
rm $IMAGEFILE
done
You can download my resize, watermark bash script here.
Tags: bash, convert, imagemagick, jhead
Posted by Hans-Henry Jakobsen
Today I stumbled upon Fred’s Imagemagick Scripts, a nice collection of bash scripts to do image manipulations like
Tags: convert, imagemagick
Posted by Hans-Henry Jakobsen
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/bash
for image in `ls *.JPG`
do
convert -resize 50x50! $image small-$image
done
montage small-*.JPG -mode Concatenate -tile 5x3 montage_final.jpg
The result file like the one below is saved with the filename montage_final.jpg.
One 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: bash, convert, imagemagick, JPG, montage
Posted by Hans-Henry Jakobsen