stb_image.h version: 2.30
- Add the stb-image-jni dependency.
- Add the natives you need:
- stb-image-jni-natives-windows (available arches: x86_64, i686)
- stb-image-jni-natives-linux (available arches: x86_64, aarch64, riscv64)
- stb-image-jni-natives-android (all ABIs available)
Android SDK: 21
Java version: 1.8
StbImage.setFlipVerticallyOnLoad(false);
int[] width = new int[1];
int[] height = new int[1];
int[] channels = new int[1];
ByteBuffer data = StbImage.load("image.png", width, height, channels, 4);
if(data == null)
throw new RuntimeException("Failed to load image: " + StbImage.failureReason());
// The pixel data consists of ${height} scanlines of ${width} pixels
StbImage.imageFree(data);
For bugs, questions and discussions please use the GitHub Issues.