Python を使って TIFF を EPS に変換する

この記事では、Python を使用して TIFF を EPS に変換する 様々な方法について説明します。すべての方法を学習して、自分に最適な方法を見つけてください。

Python による TIFF から EPS への変換

Aspose.Page による TIFF から EPS への変換品質を確認し、無料のオンライン TIFF から EPS へのコンバーター で結果を確認できます。その後、EPS ビューアー で変換後の EPS ファイルを表示できます。


手順:Python での TIFF から EPS への変換 API コード

TIFF から EPS への変換は、次の手順に従ってください。

  1. PsSaveOptions のインスタンスを作成します。
  2. PsDocument の静的メソッド save_image_to_eps を使用します。

save_image_to_eps メソッドには、TIFF 画像を EPS 形式に保存するための最も簡単な方法を提供するために、4 つの変更が加えられています。

Python で TIFF 画像を EPS 形式に保存するための文字列の使用

次の Python コードスニペットでは、入力画像と出力 EPS ファイルが文字列で割り当てられています。

 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)

Python で TIFF を EPS として保存するためのストリームの使用

次の Python コードスニペットでは、入力画像と出力 EPS ファイルがストリームによって割り当てられています。

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)

Python で TIFF を EPS に保存するために Bitmap オブジェクトと文字列を使用する

次の Python コードスニペットでは、入力画像は aspose.pydrawing.Bitmap オブジェクトによって割り当てられ、出力 EPS ファイルは文字列によって割り当てられています。

 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);

Python で TIFF を EPS に保存するための Bitmap オブジェクトとストリームの使用

次の Python コードスニペットでは、入力画像は aspose.pydrawing.Bitmap オブジェクトによって割り当てられ、出力 EPS ファイルはストリームによって割り当てられます。

 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);

TIFFからEPSへの変換については、 .NETJavaをご覧ください。

TIFF to EPS Converterで、TIFFからEPSへのオンライン変換をお試しください。複数のTIFF画像を一度にEPSファイルに変換し、数秒で結果をダウンロードできます。

サンプルファイルとデータファイルは GitHubからダウンロードできます。

その他の変換オプション:

Have any questions about Aspose.Page?



Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.