Daniel Roy
Daniel Roy

Reputation: 19

pixel length not same with size java bufferimage

i have 426px * 436px

but when i use byte[] pixels = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();

then i use system.out.printl(pixels.length) result is 557208 it is 3x 426x436 can someone explain it

Upvotes: 0

Views: 57

Answers (1)

tobii
tobii

Reputation: 517

Each pixel requires 3 bytes, 1 for red, 1 for green, 1 for blue (assuming the image is using that color format, I would expect it to be that unless you changed the format).

Upvotes: 1

Related Questions