I'm looking for a Java library that can output PNG files. In my image-creation routine, I know the image size and the color of each pixel.
I want my image-creation routine to be usable in two ways:
- as a stand-alone executable JAR file
- as a JAR library to be included in an Android project
If I needed only one of these requirements, the solution would be easy: For the stand-alone scripts, it's possible to use BufferedImage
, Graphics2D
and ImageIO
API-s that are included in Java SE; while Android has APIs included under android.graphics.*
for image creation.
However, I'd like to use the same code for both use cases. This means I need to depend on a single library that can create an image, fill it with pixels, and output as a PNG file.
So far I found only JDeli which appears to be commercial.