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

纵然是瞬间 提交于 2019-12-13 06:44:32

问题


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()



来源:https://stackoverflow.com/questions/15900642/is-it-possible-to-open-a-ljpg-lossless-jpeg-file-in-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!