Texture blue pixels

Started by Mihai_Ionut_Floares, December 02, 2020, 15:11:49

Previous topic - Next topic

Mihai_Ionut_Floares

Look at this recording please:
https://streamable.com/ockhco


Can you tell me why the texture from the plane has these blue pixels? The original png doesn't have anything blue.
I'm reading the data with java ImageIO reader:
BufferedImage bi;
bi = ImageIO.read(new File(imagepath));
int[] pixels_raw = new int[width * height * 4];
pixels_raw = bi.getRGB(0, 0, width, height, null, 0, width);
ByteBuffer pixels = BufferUtils.createByteBuffer(width * height * 4);
for(int i = 0; i < width;i++) {
				for(int j = 0;j<height;j++) {
					int pixel = pixels_raw[i*width + j];
					pixels.put((byte)((pixel >> 16) & 0xFF));
					pixels.put((byte)((pixel >> 8) & 0xFF));
					pixels.put((byte)(pixel  & 0xFF));
					pixels.put((byte)((pixel >> 24) & 0xFF));
				}
			}