int rgb = (redPixels[row][col] & 0xff) << 16 | (greenPixels[row][col] & 0xff) << 8 | (bluePixels[row][col] & 0xf


The blue channel is being masked with 0xf. Change this to 0xFF to get both...