PS2RASTER

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
NOTES
EXAMPLE
SEE ALSO

NAME

ps2raster − Converts one or several PostScript file(s) to other formats using GhostScript

SYNOPSIS

ps2raster psfile(s) [ −A ] [ −Eresolution ] [ −Gghost_path ] [ −Llistfile] [ −N ] [ −P ] [ −Te|f|j|g|m|t ]

DESCRIPTION

ps2raster reads one or more PostScript files (or a file with a list of PostScript filenames) and modifies the page size in order that the resulting image will have a size determined by the BoundingBox. As an option, a tight BoundingBox may be computed first.

psfiles

Names of PostScript files to be converted. The output files will have the same name but with the conventional extension name associated to the raster format (e.g. .jpg for the jpeg format).

OPTIONS

−A

Adjust the BoundingBox to the minimum required by the image content.

−E

Set raster resolution in dpi [default = 720 for PDF, 300 for others].

−G

Full path to your ghostscript executable. NOTE: For Unix systems this is generally not necessary. However, under Windows, GhostScript is not added to the system’s path. So either you do it yourself, or give the full path here. (e.g., −Gc:\programs\gs\gs7.05\bin\gswin32c).

−L

The listfile is an ASCII file with the names of the PostScript files to be converted.

−N

Do not remove auxiliary files (by default it does). Auxiliary files are built using as base the input PostScript files and consist of:

psfile_tmp.eps -> PostScript with a modified BoundingBox.
psfile
_tmp.bat -> script with the ghostscript command that does the job.
Use this option to save the script and run it later with different settings.

−P

Force Portrait mode. All Landscape mode plots will be rotated back so that they show unrotated in Portrait mode. This is practical when converting to image formats or preparing EPS or PDF plots for inclusion in documents.

−T

Sets the output format, where e means EPS, f means PDF, j means JPEG, g means PNG, m means PPM, and t means TIF [default is JPEG]. The EPS format can be combined with any of the other formats. For example, −Tef creates both an EPS and a PDF file.

NOTES

The conversion to raster images (JPEG, PNG, PPM or TIF) inherently results in loss of details that are available in the original PostScript file. Choose a resolution that is large enough for the application that the image will be used for. For web pages, smaller dpi values suffice, for Word documents and PowerPoint presentations a higher dpi value is recommended. ps2raster uses the loss-less Flate compression technique when creating JPEG, PNG and TIF images.

EPS is a vector, not a raster format. Therefore, the -E option has no effect on the creation of EPS files. Using the option -Te will remove PageSize commands from the PostScipt file and will adjust the BoundingBox when the -A option is used.

Although PDF is also a vector format, the -E option has an effect on the resolution of pattern fills and fonts that are stored as bitmaps in the document. ps2raster therefore uses a larger default resolution when creating PDF files. In order to obtain high-quality PDF files, the /prepress options are in effect, allowing only loss-less compression of raster images embedded in the PostScript file.

See Appendix C of the GMT Technical Reference and Cookbook for more information on how ps2raster is used to produce graphics that can be inserted into other documents (articles, presentations, posters, etc.).

EXAMPLE

To convert a the file psfile.ps to PNG using a tight BoundingBox and rotating it back to normal orientation in case it was in Landscape mode:

ps2raster psfile.ps −A −P −Tg

(This command assumes that ghostscript can be found in your system’s path.)

SEE ALSO

GMT(1)