Mehrere Bilder skalieren

Um zum Beispiel Urlaubsbilder im Web zu publizieren, möchte man diese vorher verkleinern. Komfortabel und schnell geht das mit ImageMagick und folgendem Skript:

#!/bin/sh
#
# Script for converting size of images in a directory.
#
 
 
# check if parameters are given
if [ $# -ne 2 ]
then
        echo "Usage: makeThumbnail x y"
        echo "where x is width and y is height."
        exit 1
fi
 
# create directory and convert images
mkdir -p small
for f in *.jpg
        do convert $f -resize $1x$2 small/$f
done
 
exit 0

ImageMagick muss evtl. erst noch installiert werden. unter *ubuntu und Debian z.B. mit apt-get install imagemagick.

DeliciousTwitterFacebookLinkedInRedditSlashdotTechnorati FavoritesDiggShare
This entry was posted in Linux, Tools. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">