Author: Carlos Guerra Alberti
Conversor.sh is a script programmed to convert pictures and images. Normally, digital cameras’ pictures can take lot of MB in every image, this script uses the convert program from the imagemagick packet and can reduce the space in more than 90%. Basically, the user will be able to change the picture dimensions, rotate the picture, change the picture quality, convert it into monochrome, etc, etc.
Conversor.sh can be downloaded from here
#!/bin/bash
# Picture Conversor.sh Wizzard
# Carlos Guerra Alberti 2003-2005
# mapache@carlosguerra.com
# GNU General Public License
# Requirements: "convert" from imagemagick
# "apt-get install imagemagick" for Debian Users
# convert will be allocated in /usr/bin/convert
if test -e /usr/bin/convert
then
echo ························································
echo ·
echo · Introduce the folder where your images are.
echo ·; read folder
if test -e $folder
then
echo ·
echo · Creating auxiliary folder in $folder
echo ·
mkdir $folder/aux >& /dev/null
echo · Auxiliary folder in $folder/aux
echo ·
echo · Which kind of file would you like to convert "(jpg, png...)"
echo ·; read extension
echo ·
echo · Press 0 to exit
echo · Pulsa 1 to change quality
echo · Pulsa 2 to change dimensions W*H
echo · Pulsa 3 to add a comment on each image.
echo · Pulsa 4 to transform images White and Black
echo · Pulsa 5 to rotate the image "(Grades)"
echo ·; read answer
if test "$answer" = "0"
then exit
else
if test "$answer" = "1"
then action="-quality"
echo · Insert the quality grade you want to apply
echo ·; read subaction
else
if test "$answer" = "2"
then action="-size"
echo · Insert the dimesions eg.: 300x400
echo ·; read subaction
else
if test "$answer" = "3"
then action="-comment"
echo · Insert the comment you would like to add
echo ·; read subaction
else
if test "$answer" = "4"
then action="-monochrome"
echo · This process will take a some seconds.
echo ·; subaction=""
else
if test "$answer" = "5"
then action="-rotate"
echo · Introduce the rotation grades you would like to apply Eg.: 90
echo ·; read subaction
fi
fi
fi
fi
fi
fi
cd $folder
for i in *.$extension;
do convert $action $subaction $folder/$i $folder/aux/$i
echo · Conversing image $i
done
echo ·
echo · Conversed images are allocated on $folder/aux
else
echo
echo $folder not found on the system
echo
fi
else
echo
echo Imagemagick not installed on the system
echo
fi

0 Responses to “Image conversor script wizzard for Linux”