ImageIO support for raw images (jrawio)

妖精的绣舞 提交于 2019-12-22 14:01:31

问题


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.

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

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.

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

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.

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?

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.


回答1:


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.



来源:https://stackoverflow.com/questions/17224346/imageio-support-for-raw-images-jrawio

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