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

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

25 Nov 2007 Adjust images to a digital frame (480×234 pixels)

This bash script adjusts images to fit in a digital frame with a resolution of 480×234 pixels however by using the size 832×468 pictures are displayed sharper on some frames. Normally, narrower pictures will have black borders at both sides when displayed. but this script makes the border color the average of the picture.

The following linux tools are used in the script: convert and montage, bash, od and awk. od is part of the textutils package in Debian.

#!/bin/bash
# current directory contains source JPG files
# $DESTINATION is where the prepared JPG files are stored
# $TEMP is a temporary directory
TEMP=TEMP
DESTINATION=DESTINATION
GEO=832x468 # geometry of target JPG files and resize value

for FILE in *.JPG
do
convert -resize 1x1 "$FILE" "$TEMP/1x1.bmp"
od -A n -j 54 -t u1 "$TEMP/1x1.bmp" | awk -v f="$FILE" -v des="$DESTINATION/" -v geo="$GEO" '
{
print "montage -geometry", geo, "-resize", geo, "-background rgb\\(" $3 \
"," $2 "," $1 "\\) \"" f "\" \"" des f "\"";
exit;
}'

done | sh -x

Source: comp.graphics.misc

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