Is it possible to open a ljpg (lossless jpeg) file

2019-08-27 09:44发布

问题:

Does anyone know if it is possible to open a ljpg (lossless jpeg) file in Python? (specifically I'm using spyder on Windows XP).

I've searched around on Google, here and the Python documentation and I can't see anything.

If it's not possible, I'll try to work out how to call Octave to convert it, but it would be great if I didn't have to do that.

Thanks!

回答1:

Since the below didn't work, try this wrapper: http://ebiznisz.hu/python-jpegtran/

Appears to do the trick.


http://www.pyglet.org/doc/api/pyglet.image-module.html
http://effbot.org/imagingbook/image.htm

Any of the two should be able to.

from PIL import Image
im = Image.open("test.ljpg")
im.show()