EPS_TO_JPG is a BASH script which demonstrates how to automate a task in which the same command must be issued many times to convert files from EPS format to JPEG format using the ImageMagick command convert.
A single file file.eps can be converted to JPEG format by a command like
convert file.eps file.jpgHowever, it is often the case that many files have to be converted; the straightforward approach would be to type the above command over and over, each time being careful to specify the next name from the list.
The BASH script can read a file specification such as "*.eps", expand it to a list of corresponding filenames, and form the correct invocation of convert for each of the files, handling the problem quickly and accurately.
The script has this form (EPS to JPEG) because that's what I needed. It should be obvious how to change the script to do other kinds of conversions (JPEG to PNG) or to allow any kind of input file to be converted to TIFF, and so on.
The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.
EPS, a data directory which contains examples of EPS files, the Encapsulated PostScript file format for 2D graphics;
EPS_TO_PNG, a BASH script which converts all EPS files to PNG format.
JPG, a data directory which contains examples of JPG or JPEG files, a file format for high quality 2D graphics;
Here is a collection of EPS files:
Here are the JPG files created by the script:
You can go up one level to the Examples page.