在 Python SDK 中压缩 TIFF

使用 Python 减小 TIFF 大小

使用 Python 中的 REST API,开发人员可以以编程方式压缩 TIFF。使用给定的解决方案,输出将是压缩后的高质量文件。

查看代码片段

在 Python 中压缩 TIFF

使用我们强大的 Python API,开发人员可以压缩 TIFF 以优化内容和输出文件大小。通过清理未使用的数据和资源来减小文件大小。您还可以压缩图像以使输出文件更小。

内容优化和压缩的结果可以保存为原始 TIFF 或任何可用的保存格式 - DOCX、DOC、RTF、PDF、HTML 和许多其他格式。

减少 Python 中的 TIFF 文件大小

如前所述,我们的 Python SDK 允许您以编程方式减小 TIFF 的大小。现在您可以尝试我们强大的功能,并通过以下示例评估如何在 Python 中压缩 TIFF:

上传要优化/压缩的文件
运行代码
从列表中选择目标格式
import asposewordscloud

words_api = WordsApi(client_id = '####-####-####-####-####', client_secret = '##################')

request_document = open('Input.tiff', 'rb')
request_compress_options = asposewordscloud.CompressOptions(
   images_quality=75, images_reduce_size_factor=1)
compress_document_request = asposewordscloud.models.requests.CompressDocumentOnlineRequest(
   document=request_document, compress_options=request_compress_options)
compress_document = words_api.compress_document_online(compress_document_request)

convert_document = asposewordscloud.models.requests.ConvertDocumentRequest(
   document=list(insert_paragraph.document.values())[0], format='tiff')
words_api.convert_document(convert_document)
运行代码
  
将代码Python复制到剪贴板

如何在 Python 中压缩 TIFF

  1. Aspose.Words Cloud for Python
  2. 将库引用(导入库)添加到您的 Python 项目
  3. 使用您的应用密钥配置 API
  4. 加载要压缩的源 TIFF
  5. 压缩 TIFF,清理未使用的信息
  6. 选择输出文件格式
  7. 将 TIFF 压缩的结果作为单独的文件获取

Python 库以使用 TIFF 压缩

使用 PyPi 存储库安装 Aspose.Words Cloud SDK for Python 。运行 pip install aspose-words-cloud 安装 SDK,然后通过 import asposewordscloud 导入包。作为替代方案,您可以从 GitHub 手动克隆 Aspose.Words Cloud SDK for Python 源代码并在您的项目中使用它。请按照这些 Instructions 快速获取必要的安全凭证并访问我们的 REST API。

系统要求

请参阅 Repository Documentation 以查看详细信息。

其他支持的文件格式

您可以对其他文件格式执行文档压缩:

5%

订阅 Aspose 产品更新

获取直接发送到您的邮箱的每月通讯和优惠。

© Aspose Pty Ltd 2001-2024. 版权所有。