Java: BufferedImage from raw BMP file format data
- by Victor
Hello there.
I've got BMP file's raw pixels table in byte[], it's structure is:
(b g r) (b g r) ... (b g r) padding
...
(b g r) (b g r) ... (b g r) padding
Where r, g, b are byte each, padding is to round row length up to a multiple of 4 bytes.
So, how can I create new BufferedImage from this raw data without copying, just using this raw data? I took a look at creating BufferedImage from DataBuffer, but I just didn't get it. Unfortunately ImageIO is not allowed in my situation.