是否可以在Python中打开ljpg(无损jpeg)文件? [英] Is it possible to open a ljpg (lossless jpeg) file in Python?

查看:405
本文介绍了是否可以在Python中打开ljpg(无损jpeg)文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道是否可以在Python中打开ljpg(无损jpeg)文件吗? (特别是我在Windows XP上使用的是spyder).

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

我已经在Google,此处和Python文档中进行了搜索,但看不到任何内容.

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

如果不可能,我将尝试找出如何调用Octave进行转换,但是如果我不必这样做,那将是很好的选择.

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.

谢谢!

推荐答案

由于以下操作无效,请尝试使用此包装器: http://ebiznisz.hu/python-jpegtran/

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

似乎可以解决问题.

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

这篇关于是否可以在Python中打开ljpg(无损jpeg)文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆