Inicio » image » LaTeX topics: Reducing the size of large PS files

LaTeX topics: Reducing the size of large PS files

By Kenneth M. Hanson from [http://kmh-lanl.hansonhub.com/spie/]:

If the PS file produced by DVIPS is large (>5 MB), it is probably because of the size of the EPS image files you are using for figures. DVIPS essentially copies the EPS image files directly into its output PS file. To reduce the size of the PS file, the best approach is to reduce the sizes of the image files.

PS and EPS files: PostScript documents consist of instructions for building each page. The PS markup language specifies text in terms of scalable fonts and the position of each text string, and vector graphics commands to describe graphical features. This means of specification has the advantage that a page can be scaled to any size, and the text and graphical elements still appear sharp. The disadvantage of using vector graphics is that when millions of points (or vectors) are drawn, the EPS file can become rather large or take a long time to draw on the monitor.

The PS instruction set also includes “bit-mapped” fonts and rasterized images, which appear blocky when magnified.

PS instructions are given as ASCII text, so you can open an (E)PS file with a text editor and examine the PS instructions.

An Encapsulated Postscript (EPS) file is a PS file that describes a single page. Figures in LaTeX are usually provided as EPS files. EPS files are distinguished from PS files by their BoundingBox command, found near the beginning of the file:

%%BoundingBox: 0 0 1200 900

This command specifies the position and size of the text/image area in PS units (72/inch) or for a rasterized image, its size in pixels.

When an EPS file includes a rasterized (or pixelated) image, it is defined as having a specific size, e.g., 1200 by 900 (pixels). This type of file is created when a rasterized image, such as GIF, TIFF, PNG, or JPEG, is converted to EPS. The list of pixel values can be uncompressed or compressed. The former produce a rather large file. For example, an uncompressed 1200 by 900 pixel color image will be at least 3 MB in size. The compressed type of EPS image often employs JPEG compression, and is usually much smaller. The image file mcr3b.eps, provided above for the sample manuscript, is an example of this type of EPS file.

EPS files for LaTeX: If you are using uncompressed rasterized EPS image files, the obvious way to make them much smaller is to convert them to compressed files using an application such as PhotoShop, HyperSnap, IDL, or MatLab. If a large EPS file uses vector coding, the solution is to convert it to a rasterized image file (for example, GIF, PNG, or JPEG; avoid TIFF because of copyright problems), and then convert that back to a compressed rasterized EPS file.

You should select the resolution of each rasterized image to be high enough to maintain the inherent quality of the published image or graph. A pixel density of 300 to 400 dpi (dots per inch = pixels per inch) on the printed page is often good enough. Thus, an image that will be a half-page wide (~3.4 in.), should be around 1000-1200 pixels wide. Attention should be given to the selection of the JPEG resolution option. The option of “maximum quality” is often not needed – either “high” or “medium” quality usually provides satisfactory print quality and results in a smaller file.
 

Share

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

Archivos

Categorías