Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the fastest Java Image Reader [closed]

I have a program where I have to serialize a BufferedImage to disk and then read it back in. Currently I'm using a raw image format

ImageIO.getImageReadersByFormatName("raw");

After a lot of testing it seems it's performance varies wildly on the same data (from under a second to 15 seconds).
1. Any idea what is going on to cause this?
2. What is the fastest Image reader/writer in Java to accomplish this task?

Thanks

like image 677
Jon Avatar asked Feb 01 '26 02:02

Jon


1 Answers

  1. It's hard to say what's causing such a huge difference in performance. There are all sorts of factors that could be contributing to it. See: How do I write a correct micro-benchmark in Java?
  2. This is also difficult to answer since it can depend on the data in the images, how fast your processor is and how fast your hard drive is. The only way to really know for your data set is to benchmark your different options.

That said, I'd imagine that png is a generally good choice to try out.

like image 187
WhiteFang34 Avatar answered Feb 02 '26 17:02

WhiteFang34