如何使用Python解码内存中的JPEG XR文件 [英] How to decode JPEG XR files in memory using Python

查看:127
本文介绍了如何使用Python解码内存中的JPEG XR文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Python 3处理由显微镜产生的文件,该文件本质上是数千个Jpeg XR压缩图像的集合.我需要将所有这些读取到内存中.现在,我以二进制模式读取数据,将其保存在.jxr文件中,然后调用JxrDecApp.exe将其转换为tiff并将其读回到内存.这显然是性能的主要瓶颈,因为它涉及大量文件读写.

I'm using Python 3 to process a file produced by microscope, which is essentially a collection of thousands of Jpeg XR compressed images. I need to read all of them into memory. Now I'm reading data in binary mode, saving them in .jxr file and call JxrDecApp.exe to convert it to tiff and read it back to memory. This apparently is a major bottleneck to performance because it involves a lot of file read and write.

根据我的收集,ImageMagick还将此任务委托给JxrDecApp.exe.因此,使用魔杖也无济于事.我说的对吗?

From what I gather, ImageMagick also delegates this task to JxrDecApp.exe. So using wand wouldn't help, either. Am I right?

那我想知道是否有任何方法可以使用Python解码内存中的Jpeg XR?

Then I'm wondering if there is any way to decode Jpeg XR in memory using Python?

推荐答案

imageio ?

它支持JPEG XR,并且可以读取文件名,文件对象,http,zip文件,字节,网络摄像头.

It supports JPEG XR, and can read from can read from filenames, file objects, http, zipfiles, bytes, webcams.

这篇关于如何使用Python解码内存中的JPEG XR文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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