ImageIO 支持原始图像 (jrawio) [英] ImageIO support for raw images (jrawio)

查看:27
本文介绍了ImageIO 支持原始图像 (jrawio)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找原始图像支持,并找到了这个库 (jrawio-1.6.1),它扩展了 imageio 以添加原始支持.它似乎有效,但速度非常慢.我见过速度更快的蜗牛.我的代码在几秒钟内处理 Jpeg,处理一个不太大的 .cr2 文件或 .nef 需要几分钟.我可能是错的,但我认为它甚至减慢了 tiff 处理速度.最后一个 tiff 文件非常大,所以这也可能是问题所在.

I was looking for raw image support and found this library (jrawio-1.6.1) which extends imageio to add raw support. It seems to work but awfully slow. I've seen snails that were faster. My code processes Jpegs in seconds and it takes minutes to process a not that much bigger .cr2 file or .nef. I could be wrong but I think it even slowed down the tiff processing. The last tiff file was very big so that could have been the problem too.

我对这个库的另一个问题是开发似乎在 2009 年停止了.

Another issue I have with this library is that development seems to have ceased in 2009.

我的替代方案是什么?我尝试包含 JAI,但有些库会导致应用程序在导出到可执行 jar 后崩溃.

What are my Alternatives? I tried including JAI but some of the libraries where causing the application to crash after exporting to an executable jar.

问题似乎出在 imgScalr 上,因为它的调整大小和旋转速度很慢.

It seems that the problem is imgScalr because it's the resize and rotation that are slow.

来自尼康 D300 的 11.6MB nef 文件需要 1 分 35 秒将大小调整为 20%,需要 38 分将图像旋转 90 度.

An 11.6MB nef file from a Nikon D300 takes 1 minute 35 seconds to resize to 20% and a minute 38 to rotate the image 90 degrees.

但这对我来说没有意义,因为这些图像正在被旋转和调整大小为 bufferedImages 而不是它们的原始格式.这可能是 imgScalr 的尺寸问题吗?

But this make no sense to me because these images are being rotated and resized as bufferedImages not as their original format. Could this be a size issue with imgScalr?

显然这与图像颜色类型有关.如果我将图像转换为 RGB,调整大小和旋转会很快,但转换为 RGB 需要很长时间.我正在使用 ColorConvertOp 进行转换.

Apparently it has to do with the image color type. If I convert the images to RGB the resize and rotation go fast but the conversion to the RGB takes a long time. I am using ColorConvertOp to do the conversions.

推荐答案

看来是 jrawio 库没有问题.问题是原始图像的颜色格式.Scalr 处理 ARGB 或 RGB 颜色格式的速度要快得多,如果您在修改图像之前将图像转换为 ARGB 或 RGB,则修改速度将与 JPEG 一样快.但是,转换本身所需的时间与其中一项修改的时间一样长.

It appears that the jrawio library is not the problem. The problem is the color format of the raw image. Scalr works much faster with ARGB or RGB color formats and if you convert the image to ARGB or RGB before modifying the image the modifications will go just as fast as the JPEGs. However the conversion itself takes as long as one of the modifications.

这篇关于ImageIO 支持原始图像 (jrawio)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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