EPS (.eps, .epsf)
- Import and Export generally create PostScript level 2 files, and include certain level 3 features if appropriate.
Background & Context
-
- MIME types: application/postscript, application/eps, application/x-eps, image/eps, image/x-eps
- EPS page description language and file format.
- Commonly used in 2D vector graphics and page layout applications.
- Self-contained PostScript fragment, suitable for inclusion in other documents.
- EPS is an acronym derived from Encapsulated PostScript.
- Plain text format.
- Stores text and vector graphics using the PostScript language.
- Can include fonts and embedded raster graphics.
- Supports various color encodings, including monochrome, grayscale, RGB, and CMYK.
- Precursor to PDF.
- PostScript was introduced in 1984 by Adobe.
Import & Export
- Import["file.eps"] imports an EPS file, returning its content as graphics.
- Import["file.eps",elem] imports the specified element from an EPS file.
- The import format can be specified with Import["file","EPS"] or Import["file",{"EPS",elem,…}].
- Export["file.eps",expr] exports an arbitrary text string, vector graphics, Notebook or Cell expression to EPS.
- The export format can be explicitly specified with the command Export["file",expr,"EPS"].
- Export["file.eps",{elem1->expr1,elem2->expr2,…},"Rules"] uses rules to specify the elements to be exported.
- Wolfram System fonts and other nonstandard fonts are by default embedded in the exported file if necessary.
- Export["file.eps",expr] effectively renders expr as if it were being printed to the default printer. If expr is not a notebook, it will effectively create a notebook with the same properties as the notebook performing the evaluation, or a default notebook if the evaluation did not start in a notebook. The front end's PrintingStyleEnvironment option is used to pick the environment for printing.
- The Wolfram Language attempts to preserve a vector description of the content where possible, but content requiring modern rendering methods not supported by EPS will be rasterized. This includes all 3D graphics and 2D content with transparency, color gradients, textures or shading.
- See the following reference pages for full general information:
-
Import, Export import from or export to a file CloudImport, CloudExport import from or export to a cloud object ImportString, ExportString import from or export to a string ImportByteArray, ExportByteArray import from or export to a byte array
Import Elements
- General Import elements:
-
"Elements" list of elements and options available in this file "Summary" summary of the file "Rules" list of rules for all available elements - Data representation elements:
-
"Graphics" arbitrary 2D graphics "Plaintext" textual content given as a string "Image" raster image "Preview" embedded preview image - Import and Export use the "Graphics" element by default.
Options
- General options:
-
Background Automatic background color shown in transparent image regions ImageSize Automatic overall image size ImageResolution 72 image resolution for rasterization in dpi - Advanced Export options:
-
"AllowRasterization" Automatic whether to rasterize 2D and 3D graphics "EmbeddedFonts" True whether to include nonstandard fonts "PreviewFormat" None format of the image preview to be included - Possible settings for "PreviewFormat" are:
-
None no embedded preview "Interchange" device-independent preview (EPSI) "Metafile" Windows metafile preview (WMF) "TIFF" TIFF raster image - Possible settings for "AllowRasterization":
-
Automatic rasterize graphics with features such as transparency that cannot be reproduced faithfully in EPS True always rasterize graphics False always use vector graphics
Examples
Basic Examples (7)
Import an EPS file as vector graphics:
Export vector graphics to EPS:
Export a function plot to EPS:
When converting output containing characters to EPS, the Wolfram System by default includes all nonstandard fonts in the exported document:
This exports a Cell expression to EPS:
This converts a Notebook expression to EPS: