在 Python 中将 JPG转换为TIFF

用于将JPG转换为TIFF的高速软件Python

使用我们的文档转换 API 在 Python 中开发高级、平台独立的软件。这是一个完整的专业软件解决方案,可Python JPG, TIFF和许多其他文档格式。

查看代码片段

转换 JPG 到 TIFF 在 Python

需要以 JPG 图像 TIFF 格式吗?随着Aspose.Words for Python via .NET任何开发人员可以轻松地将 JPG 成 TIFF 只需几行 Python 代码。

现代图像处理 Python API 从 JPG 图片高速 TIFF 直接在浏览器中 JPG 到 TIFF 图像转换的质量。强大的 Python 库允许将 JPG 图像转换为许多流行的图形格式。

保存 JPG 如 TIFF 在 Python

以下示例演示如何将 JPG 中的 TIFF Python 。

按照简单的步骤将 JPG 转换为 TIFF 格式。从本地驱动器读取 JPG 图像,然后将其保存为 TIFF TIFF 扩展名指定所需的图像格式。对于 JPG 读取和 TIFF 写入,您可以使用完全限定的文件名。输出 TIFF 内容将与原始 JPG 图像相同。

Python代码示例将JPG转换为TIFF格式
上传您要转换的文件
运行代码
从列表中选择目标格式
import aspose.words as aw

doc = aw.Document()
builder = aw.DocumentBuilder(doc)

shape = builder.insert_image("Input.jpg")
shape.get_shape_renderer().save("Output.tiff", aw.saving.ImageSaveOptions(aw.SaveFormat.TIFF))
import aspose.words as aw doc = aw.Document("Input.jpg") doc.save("Output.tiff") import aspose.words as aw doc = aw.Document(Input.jpg) for page in range(0, doc.page_count): extractedPage = doc.extract_pages(page, 1) extractedPage.save(f"Output_{page + 1}.tiff") import aspose.words as aw doc = aw.Document() builder = aw.DocumentBuilder(doc) builder.insert_image("Input.jpg") doc.save("Output.tiff") import aspose.words as aw doc = aw.Document() builder = aw.DocumentBuilder(doc) shape = builder.insert_image("Input.jpg") shape.get_shape_renderer().save("Output.tiff", aw.saving.ImageSaveOptions(aw.SaveFormat.tiff))
运行代码
在社交媒体上分享代码:

如何将JPG转换为TIFF

  1. Aspose.Words for Python via .NET安装 Aspose.Words。
  2. 将库引用(导入库)添加到您的Python项目。.
  3. 在Python打开源JPG文件。.
  4. 调用save()方法,传递带有TIFF扩展名的输出文件名。.
  5. JPG转换的结果TIFF 。.

Python库将JPG转换为TIFF

我们在PyPi存储库中托管我们的 Python 请按照有关如何 "Aspose.Words for Python via .NET" 安装到您的开发人员环境的分步说明进行操作。

系统要求

这个包与 Python ≥3.5 和 <3.12 兼容。如果您为 Linux 开发软件,请查看产品文档中对 gcc 和 libpython 的附加要求。

5%

订阅 Aspose 产品更新

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

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