Link

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);

See the full Javadoc.

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.

Benchmark Mode Cnt Score Error Units
PNG.Apache thrpt 25 52.299 ± 0.837 ops/s
PNG.ImageIO thrpt 25 9.398 ± 0.409 ops/s
PNG.JDeli thrpt 25 83.952 ± 3.421 ops/s

Tested on 2020 16inch MacBook Pro using OpenJDK 14.0.1 - 11th March 2021