Java PNG Reader
JDeli includes a PNG Reader to read PNG images into Java. The PNG Decoder is written in 100% Java with no dependencies.
Key information:
- 100% Java solution. No dlls or dependencies on native code
- Support: interlacing, filtering
- Bit Per Sample: 1, 2, 4, 8 and 16-Bits
Quick start:
JDeli can automatically detect the file type and will use the PNG File Reader
BufferedImage image = JDeli.read(pngImageFile);
or
PngDecoder decoder = new PngDecoder();
BufferedImage image = decoder.read(pngData);
Performance comparisons:
These figures were generated using jmh (as documented on our blog) with a standard set of images (also documented). They should be easy to replicate if you wish to validate, the code is on GitHub.
The higher the number, the better.
Mode: Throughput Count: 25 Units: ops/s
Benchmark | Score | Error |
---|---|---|
Apache | 1151.556 | ± 12.405 |
ImageIO | 296.915 | ± 12.564 |
JDeli | 2160.496 | ± 43.874 |
Tested on 2021 14inch M1 MacBook Pro using JDK 18.0.1.1