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

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

问题描述

我一直在寻找原始图像支持,并找到了该库(jrawio-1.6.1),该库扩展了imageio以添加原始支持.它似乎可以工作,但是速度很慢.我看过蜗牛更快.我的代码在几秒钟内处理了Jpegs,处理一个不那么大的.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天全站免登陆