Hello,
This question can have multiple answers and can be quite complicated.
I am not an engineer nor can I vouch for the precise definition of this answer but I can speak from the understanding from a graphic designer's standpoint.
Computers take in information through programmed language. Someone needed to program a language in order for computers to translate information, operate, display, receive and respond to direction. Different types of commands, equations, formulas (coding) needed to be predetermined for the computer to do anything.
So, for an image to be recognized, the computer needs the programmed code to receive and translate what specific colors would be recognized. To a computer images are most likely received as information that tells it how a compilation of dots (pixels) is placed on a grid-like system (if you imagine graph paper), especially dealing with files as (.jpg, .gif, .png, .tif, .psd, .raw, etc.) These type of images are described as bitmap images and are the most commonly used.
Another type of file that is commonly used with designers (less commonly used by general public) are vector files (.ai, .svg, some .eps/.pdfs, etc.). On a very basic level, I use the analogy that computers receive and output these images through mathematical equations based on points, lines and curves. The sum of the images is NOT counted by how many dots (bitmap pixels) are present, but by formulaic equations of the points, lines and shapes and then assigned a color value.
For added bonus information:
From a screen (tv, laptop, phone, iPad, etc.) colors are displayed through light values (that is why the screens need light to shine through the display.)
Generally speaking, a computer is programmed to take information of an image, calculate many dots (pixels) that create the whole image, and attribute the color light value to each dot so that it can be displayed to the viewer. There are different types of color value systems that are coded and the computer takes the code of the value system that the viewer (or default of the computer system) has selected. Then the computer will attribute that color where it is assigned according to the image information read by the computer.