EPS_TO_PNG 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 PNG format using the ImageMagick command convert.
A single file file.eps can be converted to PNG format by a command like
convert file.eps file.pngHowever, 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 PNG) 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.
./eps_to_png.sh fileswhere
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_JPG, a BASH script which converts all EPS files to JPG format.
PNG, a data directory which contains examples of PNG files, a file format for 2D graphics;
Here is a collection of EPS files:
Here are the PNG files created by the script:
You can go up one level to the Examples page.