Everything is numbers, stored as binary - text, programs, images, sounds, it's all just binary data whether in RAM or stored on a hard drive.
For images, each 0-255 range is stored as an eight bit binary number, a byte.
Eight 1s & 0s; 24 bits, three bytes for an RGB pixel or or 32 bits / 4 bytes for each RGBA pixel, with an "Alpha" transparency value.
It's down to the programs to use the stored numbers in the correct way.
Most types of files on PCs, other than plain text, have a header section that gives information about the rest of the content and how it is organised, to help ensure it is used correctly.