Convert TIFF to EPS using Python

This article explains how to convert TIFF to EPS using Python in different ways. Learn all to find the one that suits you best.

Python TIFF to EPS Conversion

You can check the quality of Aspose.Page TIFF to EPS conversion and view the results via free online TIFF to EPS Converter and than view the resulting EPS file with our EPS Viewer


Steps: TIFF to EPS Converter API Code in Python

Follow the next order to perform TIFF to EPS conversion:

  1. Create an instance of PsSaveOptions.
  2. Use static method save_image_to_eps of PsDocument.

The save_image_to_eps methods has four modifications to provide a user with the most comfortable way to save TIFF image to EPS.

Using strings for saving TIFF as EPS in Python

In the following Python code snippet the input image and the output EPS file are assigned by strings:

 1# For complete examples and data files, please go to https://github.com/aspose-page/Aspose.Page-for-Python-.NET
 2
 3# The path to the documents directory.
 4data_dir = Util.get_data_dir_working_with_image_conversion()
 5
 6# Create default options
 7options = PsSaveOptions()
 8
 9# Save TIFF image as EPS file
10PsDocument.save_image_as_eps(data_dir + "input1.tiff", data_dir + "output1.eps", options)

Using streams for saving TIFF as EPS in Python

In the following Python code snippet an input image and an output EPS file are assigned by streams:

1# For complete examples and data files, please go to https://github.com/aspose-page/Aspose.Page-for-Python-.NET
2
3data_dir = Util.get_data_dir_working_with_image_conversion()
4
5# Create default options
6options = PsSaveOptions()
7
8# Save TIFF image as EPS file
9PsDocument.save_image_as_eps(inputStream, outputStream, options)

Using a Bitmap object and string for saving TIFF to EPS in Python

In the following Python code snippet an input image is assigned by the aspose.pydrawing.Bitmap object and the output EPS file is assigned by string:

 1# For complete examples and data files, please go to https://github.com/aspose-page/Aspose.Page-for-Python-.NET
 2
 3# The path to the documents directory.
 4data_dir = Util.get_data_dir_working_with_image_conversion()
 5
 6# Create default options
 7options = PsSaveOptions()
 8
 9# Create the Bitmap object from the image file
10tiff = aspose.pydrawing.Bitmap(open(dataDir + "input1.tiff")))
11
12# Save TIFF image to EPS file
13PsDocument.save_image_as_eps(tiff, dataDir + "output1.eps", options);

Using a Bitmap object and stream for saving TIFF to EPS in Python

In the following Python code snippet an input image is assigned by the aspose.pydrawing.Bitmap object and the output EPS file is assigned by stream:

 1# For complete examples and data files, please go to https://github.com/aspose-page/Aspose.Page-for-Python-.NET
 2
 3# The path to the documents directory.
 4data_dir = Util.get_data_dir_working_with_image_conversion()
 5
 6# Create default options
 7options = PsSaveOptions()
 8
 9# Create the Bitmap object from the image file
10tiff = aspose.pydrawing.Bitmap(open(dataDir + "input1.tiff")))
11
12# Save TIFF image to output stream
13PsDocument.save_image_as_eps(tiff, outputStream, options);

See TIFF to EPS conversion in .NET, Java.

Evaluate TIFF to EPS conversion online on our TIFF to EPS Converter. You can convert several TIFF image to EPS files at once and dowload results in a few seconds.

You can download examples and data files from GitHub.

Other conversion options:

Have any questions about Aspose.Page?



Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.