Вопрос

Is there a python library to convert jpgs to multipage tiffs? The best I could find is FreeImagePy but the documentation is really bad.

Thanks.

Это было полезно?

Решение 2

I figured out how to do this using the FreeImagePy libary.

import FreeImagePy as FIPY
F = FIPY.Image()
F.new(multiBitmap = "multipage.tiff")
F.appendPage("test1.jpg")
F.appendPage("test2.jpg")
F.deletePage(0)
F.close()

The output file is a multipage tiff file.

EDIT: I am having a problem with unusually large file sizes. Does anyone know how to compress the resulting multipage tiff file when the file is being generated?

Другие советы

You can also try Python Imaging Library (PIL)( This Tutorial contains good explanation ). Can use it as

import Image
im = Image.open('test.jpg')
im.save('test.tiff')  # or 'test.tif'
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top