Java GIF Reader
JDeli includes a GIF Reader to read GIF images into Java. The GIF Decoder is written in 100% Java with no dependencies.
Key information:
- 100% Java solution. No dlls or dependencies on native code
- supports gif spec 87a and 89a
Quick start:
JDeli can automatically detect the file type and will use the GIF File Reader
BufferedImage image = JDeli.read(gifImageFile);
or
GifDecoder decoder = new GifDecoder();
BufferedImage image = decoder.read(gifData);
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 |
---|---|---|---|---|---|
GIF.Apache | thrpt | 25 | 4.380 | ± 0.011 | ops/s |
GIF.ImageIO | thrpt | 25 | 1.652 | ± 0.011 | ops/s |
GIF.JDeli | thrpt | 25 | 5.357 | ± 0.140 | ops/s |
Tested on 2020 13inch M1 MacBook Pro using JDK 18.0.1.1