EPSTools Manual
Name
EPS Tools (version 2015/08/01)
Synopsis
eps2jpg [options] [psfile] epsfile(s)
eps2pdf [options] [psfile] epsfile(s)
eps2png [options] [psfile] epsfile(s)
The shell scripts eps2jpg, eps2pdf and eps2png convert the EPS files specified on the command line to JPEG, PDF or PNG, respectively. The files to be converted must have the file extension .eps, but you do not have to specify this extension on the command line explicitly (i.e., eps2png foo has the same effect as eps2png foo.eps, et cetera).
Common options
Use this option to automatically detect the tightest possible Bounding Box around the image. This may help if the EPS file is missing a correct Bounding Box, or to get rid of a small white margin around the image.
-d res[,vres]
This option specifies the resolution used to render the image (in dots per inch). In the case of eps2pdf, images in the EPS file will be (down)sampled at the specified resolution, and color and grayscale images will also be antialised. For eps2jpg and eps2png only, it is possible to specify different horizontal and vertical resolutions. For instance, -d300,200 specifies a horizontal resolution of 300 dpi and a vertical resolution of 200 dpi. The default resolution for eps2jpg and eps2png is 300 dpi in both directions.
-f
Force the scripts to overwrite existing files, instead of pausing and prompting you.
-h height
Scale the image to the desired height. Acceptable units for the height are cm for centimeters, mm for millimeters and in for inches. The scripts eps2jpg and eps2png also accept px for pixels. For example, eps2png -h200px creates an image 200 pixels in height (at the given resolution). If you don't specify a unit, the height is interpreted in PostScript points, of which there are 72 per inch, so -h72 results in an image 1 inch in height. The horizontal scaling will be equal to the vertical scaling if you do not use the -w option as well. The -s option is ignored when you use this option.
-H
Use the HiResBoundingBox instead of the normal BoundingBox to determine the image size.
-o directory
Choose the output directory. If you do not specify an output directory explicitly, the output directory equals the input directory.
-r angle
Rotate the image counter-clockwise by the specified angle (in degrees). Scaling is always performed before rotation.
-s sc[,ysc]
Scale the image by a given scaling factor. For instance, -s2 will blow up the image by a factor 2. If you specify two scaling factors (as in -s1,2), the first is used for the horizontal scaling, and the second for the vertical scaling. Scaling is always performed before rotation.
-w width
Scale the image to the desired width. Units are the same as for the -h option. The vertical scaling will be equal to the horizontal scaling if you do not use the -h option as well. The -s option is ignored when you use this option.
Specific options for eps2jpg
Sets the antialiasing sampling size. Allowed values for the sampling size are 0 (no antialiasing), 1, 2 and 4. The default value is 4. If you provide a single sample size (as in -a 1), the same sample size is used for text and graphics antialiasing. If you provide two sample sizes (as in -a 2,0), the first is used for graphics and the second for text.
-c
Sets the color space of the JPEG file to CMYK. This requires Ghostscript 8.63 or higher.
-g
Creates a grayscale (instead of color) JPEG file.
-q quality
This option sets the quality level of the JPEG output. The quality level is a number between 0 and 100. The default is 75.
Specific options for eps2pdf
Color and grayscale images in the EPS file are normally recompressed using (lossless) Flate Encoding. The -j option causes eps2pdf to use (lossy) JPEG Encoding instead. The parameter sets the quality factor, which must be an integer between 1 and 100.
-l level
Sets the PDF compatibility level. Here level must be either 1.2, 1.3 or 1.4. The default level is 1.3.
-m model
Use this option to specify the color model. Possible color models are CMYK, RGB and Gray (note that these names are case sensitive).
Specific options for eps2png
Sets the antialiasing sampling size. Allowed values for the sampling size are 0 (no antialiasing), 1, 2 and 4. The default value is 4. If you provide a single sample size (as in -a 1), the same sample size is used for text and graphics antialiasing. If you provide two sample sizes (as in -a 2,0), the first is used for graphics and the second for text.
-m mode
Use this option to specify the png file mode. Possible modes are 16, 48, 256, 16m, alpha, mono and gray. The default is 16m. Availability of these modes depends on your version of Ghostscript.
-t
Create a transparent PNG file (equivalent to -m alpha).
Prepending PostScript files
If a file with extension .ps appears in the list of files passed on to eps2jpg, the contents of that file will be processed just before each of the following .eps files in the list is rendered. This allows for advanced control over the rendering procedure.
Examples
To convert all EPS files in the current directory to JPEG at the default resolution of 300dpi, simply type
eps2jpg *.eps
The following two commands both create an image of 300 by 200 pixels, but the first will have a print size of 1 by 1 inches, whereas the second will have a print size of 1.5 by 1 inches:
eps2jpg -d300,200 -w300px -h200px foo.eps
eps2jpg -d200 -w1.5in -h1in foo.eps