Jan 20, 2009

imagemagick script for thumbnails


Goodie, goodie - another try with imagemagick scripting - This time, the purpose is to generate thumbnail(s) with fixed width and with some little blur around the pictures ... just like the picture on the left.

Why ? because I'm using "phpwebgallery" and they recommend to generate the thumbnails externally before sending them over ftp to the website - to have the thumbnails in a sub-folder.

Anyway here's the script I made "export_thumb.sh"

#!/bin/sh
# export_thumb.sh
# ------------------------------------
# using imagemagick this script has to be launched from within
# the directory with your pictures (in jpg format) and it will
# exports thumb files 184 width in a sub directory named "thumb"

# create sub folder if it's not created already
if `test -d thumb`; then echo "thumb exists"; else mkdir thumb; fi

for i in *.jpg;
do
convert $i -thumbnail "184" \( +clone -blur 0x3 +level 20%,100% \) \
\( +clone -gamma 0 -shave 10x10 \
-bordercolor white -border 10x10 \) \
-composite \
\( +clone -gamma 0 -shave 10x10 \
-bordercolor white -border 1x1 \
-bordercolor black -border 9x9 \) \
-compose screen -composite \
thumb/$i
echo ".\c";
done
xmessage "OK ! script ended with Success";

There's a lot of other good examples on this page Thumbnails -- IM v6 Examples

No comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • A little pseudo painting using ArtRage2 - "Spring" is the word !
  • What is it lately, this unexplainable need to change everything that works ? What about this idiom " if it ain't broke, don't ...
  • Hannah Wagner (better known by her stage name Miss Hannah Minx; born Oct. 1990) is an American vlogger known on Youtube for her Kawaii ...
  • After I gave a shot at ArtRage2 bundled with the Wacom tablet, I took the other cd that was in the box - and installed .... Photoshop Eleme...

AltStyle によって変換されたページ (->オリジナル) /