Resolved: How to convert an ARGB byte[] to BufferedImage


I have a byte[] that contains ARGB image data directly. I am trying to find the most performant way to transform this into a BufferedImage without unnecessary iterations, essentially I’d like to configure the BufferedImage with the right raster and color model to use this memory area directly.
My current approach is this:
I keep playing around with the color model, the bands and all that but can’t figure out what’s the right configuration for this relatively simple problem.
When I inspect the output image, it unfortunately looks bad, it’s a grayscale image with patterns:
enter image description here
Here is the original image for reference:
enter image description here

Best Answer:

If you have better answer, please add a comment about this, thank you!