What is an image?

Mohammed El Amine Mokhtari
Computer Vision Solutions
4 min readJan 27, 2021

If we talk about an image, each one of us will see it a different way, right?

The original article on my blog website here.

An image of some items for describing what is an image for a medium article

When you look at an image like the one below, you see a scene with some objects (book, glasses …). In reality, this image is just some pixels combined!

What is a pixel?

The pixel is an electronic component that is similar to an LED if we are talking about RGB images. As we know, there are 3 basic colors that we mix to have any color we want. Red, Green, and Blue.

So here if we take this image and we see its values, you will see that we have a 3D matrix. This means that we have 3 channels. The first one is for the red color, the second is for the green, and the last one is for the blue. So when we mix these three channels we will have an RGB image like our example.

If we talk about a pixel, the idea is very easy. Imagine with me you have a watercolor to paint on white paper using only the three basic colors. We can get any color we want like this. So if you want to paint something you will take these three colors mix them and then add water you will have the color that you want for your painting.

An image of watercolors for a medium article

So we need more colors! Now it comes down to the idea of the watercolors. We said that to have any color we need to mix the three basic colors. If we want to control its brightness we can add water to make it more bright or we add more color to have a dark color.

An image that describe a pixel for my medium article

The RGB image

I think that now you can imagine with me what an image is! If we say that a pixel is a little square that can give us any color we want depending on which basic color we need, then an image is a set of these squares. If we take a photo using a camera, our smartphone, or any other device that can capture photos, then all that we are doing is filling these pixels.

this subject is another thing about how do the sensors work to extract the colors from the light … but that’s it.

Now after knowing the basic idea about what an image is, you can understand some of the information that we hear every day. For example, in TVs, we see that there are LED screens and LCD screens. An LED TV (the name of these types of TVs is LED) means that the pixels of its screen are made by a type of LED. And for the LCD we didn’t talk about it but it’s something different it’s made by some liquid. We don’t need it for the moment because our subject is the image, not the displays.

The monochrome image (grayscale images)

I know that a lot of you will ask me why I didn’t start with the monochrome (grayscale) image. Because it is very easy, it is the basic image, and it has been created before the RGB image. But my idea is to talk about the more popular type of images so that we can have real examples of them. Now you will see that the monochrome image is very easy.

So monochrome images are white and black images. which means the old images with one channel. You remember that for the RGB images we said that we have 3 channels, and each channel is responsible for one color (red, green, or blue). In the monochrome image, we only have one channel but, in this case, it is neither red color nor green nor blue, but it contains the mean of the three colors. This means in each pixel we have the average value of red, green, and blue values.

Now it’s up to you how to do that (if you are interested to do it by yourself). So, for that, I will use MATLAB, which is the easiest one for image processing, and here is the result that we will get:

If you are interested and you want to try it by yourself using MATLAB here is the code:

--

--

Mohammed El Amine Mokhtari
Computer Vision Solutions

I'm a computer vision research assistant, YouTuber and online content creator. Co-founder at: https://pycad.co/