An int can hold 32 bits of data. 32 bits == 4 bytes. Which further equals 1 int (I.e, an int is made up of 4 bytes).
A pixel/color is a bucket of data that holds 3 colours: Red, Green and Blue. Why? Because using those 3 colours we can
trick the human eye to see over 16 million different colours (255 * 255 * 255).

So because an int can hold up to 4 bytes a pixel is usually represented as an int. Sometimes the last byte is used for transparency (Alpha).
You are saving the r, g and b values as ints which make them all look something like this:
0000 0000 0000 0000 0000 0000
0000 0000With the
last first (bits are read from right to left) 2 bytes (8 bits) actually representing the given colour value (0-255).
So to pack them all together into 1 int you need to combine the bits and shift the Red colour 2 bytes (16 bits) to the left and the Green byte 1 byte (8 bits) to the left using the
universal bitwise or operator so that you get them in the nice RGB order.
Or you could simply create the java Colour object
using the "Color(int, int, int)" contructor. and skip the whole bit combining business.