Domanda

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.

È stato utile?

Soluzione 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?

Altri suggerimenti

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'
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top