String intToBinary(int pixel) { String binary = pixel.toRadixString(2); while (binary.length < 8) { binary = "0" + binary; } return binary; }