Manipulating EPS Images

Export EPS images to other formats

         The Encapsulated Postscript file (EPS) is a vector graphics format with a history dating back to the 1980s. Even today, EPS remains a popular choice for combining text, graphics, and images, and it can be edited using vector graphic editor programs. The Aspose.Imaging graphic library offers methods to programmatically manipulate EPS images and export them to various standard image formats, such as JPG, PNG, SVG, TIFF, PSD or PDF.

In the C# code example below, we demonstrate how to load an EPS file and save it in SVG and PNG formats. When saving in PNG format, we utilize an additional option PngColorType.Grayscale to set the Grayscale palette:

When converting EPS to PDF, you can set the required PDF compliance using the PdfComplianceVersion.PdfA1b option:

Resize EPS images before export

         Before converting the EPS image to another format, you have the flexibility to perform various manipulations. For instance, you can resize the image to larger dimensions by doubling the original width and height values:

Extract preview image from the EPS files

         EPS files usually contain a low-resolution preview image in black and white, which is compatible with various operating systems and can be rendered by most graphic applications. With the Aspose.Imaging library, you can extract the preview image and save it as a separate image file. In the example below, we use the EpsImage.GetPreviewImage method to obtain the existing preview image in a specific format. In our case, the preview is in TIFF format, and you can also get the preview image in WMF or JPEG formats using the appropriate values from the EpsPreviewFormat enumeration: