Friday, October 9, 2009

How to convert a set of eps pictures to jpg format?

If you have a linux system with ImageMagick installed this is easy.

While I refer to jpg and eps files in this howto, conversion between any two formats that ImageMagick supports is similar.

Let us say you have a directory full of eps files along with non eps files. A simple shell script using "sed" will do the trick


for i in *.eps
do
  prefix=`echo $i | sed 's/\.eps//'`
  suffix=".jpg"
  newfile=`echo "$prefix$suffix"`
  convert -density 300 -units PixelsPerInch $i $newfile
done

No comments: