Contents

Home Contact Research Tools LaTeX

eps2jpg Manual Page

Name

eps2jpg (version 2011/06/01) - converts EPS files to JPEG

Synopsis

eps2jpg [options] [psfile] epsfile(s)

The shell script eps2jpg converts the EPS files specified on the command line to JPEG. The files to be converted must have the extension .eps, but you do not have to specify the extension on the command line explicitly.

Options

-a aa[,textaa]

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.


-B

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.


-c

Create a JPEG file in CMYK colour space. Requires Ghostscript 8.63 or higher.


-C

Normally, eps2jpg maps colours through a CIE colour space when converting between CMYK and RGB, which often results in more accurate colours. The -C switch turns this feature off.


-d res[,vres]

This option specifies the resolution used to render the image (in dots per inch). The default resolution is 300. You can specify different horizontal and vertical resolutions. For instance, -d 300,200 specifies a horizontal resolution of 300 dpi and a vertical resolution of 200 dpi.


-f

Force eps2jpg to overwrite existing files, instead of pausing and prompting you.


-g

Create a grayscale (instead of colour) JPEG file.


-h height

Scale the image to the desired height. Acceptable units for the height are cm, mm, in and px. For example, -h 200px creates an image of 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. 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 (the output directory is equal to the input directory by default).


-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.


-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. If you specify two scaling factors (as in -s 1,2), the first is used for horizontal scaling, and the second for 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.

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 next .eps file in the list is rendered. This allows for advanced control over the rendering procedure.

One possible use of this feature is to apply a PostScript CRD to dictate how eps2jpg should render an EPS file to a different colour space (e.g. an EPS file in CMYK colours to a JPEG file in RGB colours). For example, if you have an ICC Color Profile SWOP.icc, you can use the icc2ps utility that comes with LitteCMS to create a CRD, and pass this on to eps2jpg as follows:

icc2ps -u -oSWOP.icc > CRD.ps
echo setcolorrendering >> CRD.ps
eps2jpg CRD.ps foo.eps

Further examples

To convert all EPS files in the current directory to JPEG, 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 inch, whereas the second will have a print size of 1.5 by 1 inch:

eps2jpg -d 300,200 -w 300px -h 200px foo.eps
eps2jpg -d 200 -w 1.5in -h 1in foo.eps