Parse RGB and feeds in Photoshop

Do you know Photoshop is color blind?
When I say “color blind”, I do not mean small problems with the perception of shades of green and purple. I mean that he does not distinguish colors at all. All Photoshop sees are black and white. Black, white and lots of intermediate shades of gray. The most powerful graphic editor in the world, the industry standard among photographers, designers and almost all creative professionals, capable of producing millions and even billions of colors, has no idea what color is.

You can look at your photo of the crystal blue waters of the ocean that you made during your last vacation, but Photoshop sees it as a gray ocean. Did you manage to photograph a rainbow crossing the sky after an evening summer hurricane? Photoshop sees it as a beautiful set of shades of gray. And what about the famous pot of gold? For Photoshop, this is just a big pot of something gray.
Do not sympathize with Photoshop. He is absolutely happy in his colorless world.

In fact, the only reason Photoshop shows us an image in color is because people themselves expect to see them in color. We would not know what to think if everything was displayed in black and white. But not Photoshop. For him, there is nothing more expensive than black, white and gray colors.

So, Photoshop has no idea what color it is in front of it, and all that it knows and sees is black, white and gray, how does it show us images in color? I mean this image, which is open in Photoshop:

Photos open in Photoshop document window.

Obviously, this boy (or girl) is colored. Well, really, I don’t think there are more colorful birds than this one. But here is not only a bird. Leaves on a colored background. The piece of wood on which the bird sits is also in color. Everything in the image is colored! And this image is open in Photoshop, so how can this be, if Photoshop does not distinguish colors? And if he doesn’t really see color, how does Photoshop do such a great job of showing us something that he doesn’t see?

To answer this question, we need to consider two things. The first is color modes (colormode) and second – color channels (channels). Both are very interrelated if you understand color modes (colormode), that color channels (colorchannels) for you also become clearer.

We know, or at least agreed with the fact that Photoshop does not see color. All he sees is black, white and gray. So how does he take these black, white and gray colors, turning them into color, which we see on our screen? The answer is addiction. Dependence on what, you ask? It is a dependency on color mode (colormode), which uses photoshop.

There are very few color modes in Photoshop, but the two main ones are RGB and CMYK. A couple of others, you could hear in the process of working with Photoshop, this Grayscale (Grayscale) and Lab (pronounced “el-hey-bee”, but not “Lab”). These are all examples of color modes, and they define how Photoshop converts its black and white information into color, with the exception of the color mode. Grayscale (Grayscale) which does not use colors. This is a strictly black and white mode, and quite often it is used to quickly convert a color image into black and white.

Of all the four modes that I have named, the only one that we will consider is RGB. CMYK mode is suitable for printing and publishing, we will return to it some other time. Mode Grayscale (Grayscale), as I said, it is used strictly for black and white images, and Lab mode is not understandable for most people living on this planet, as well as living on other planets, although it is often used for professional image editing, but even those who it is used, do not have a complete picture of how it works. That leaves us with only RGB.

Of course, the most widely used color mode in computers and technologies in the world is the RGB color mode. Photoshop uses it, other programs on your computer also use it, your monitor, digital camera and scanner, your TV, and even the small screen of your mobile or iPod use this mode, as well as portable gaming systems like Sony’s PSP or Nintendo DS . If it is a device that somehow displays or creates images, or image editing software like Photoshop, it uses the RGB color mode. Sounds loud enough, right? And, of course, it is. For all, it has a rather broad meaning and importance, RGB is an abbreviation of three colors – red (red) green (green) and blue (blue).

Rgb and color channels: the color world of red, green and blue.
What is so unusual about these three colors – red, green and blue? Yes, in general, only that they are primary colors. What does it mean? This means that every color that you and I can see is created from some combination of red, green, and blue. How do we get yellow? By mixing red and green. How do we get purple? By mixing red and blue. What about orange? 100% red and 50% green. And these are just simple examples. Every single color we see is created using a combination of these three colors. I know it sounds almost impossible, but it really is.
When you mix the brightest versions of these colors together, you get a pure white color. When you completely remove all these three colors, you get pure black. And when you mix an equal amount as a percentage from 0 to 100%, you get shades of gray.
Let’s look at our bird image again:

In fact, a very colorful image, but where do all these colors come from? Let me explain for beginners, let’s look at the information that is communicated to us at the top of the Photoshop document window:

Information at the top of the document window.

By marking the red circle, Photoshop tells us that the image is used in the RGB color mode, which means that each color we see in the photo is created from some combination of red, green, and blue. If you want to make sure of this, all you need is to hover your mouse over any part of the image and look at Information Bar (Info) in Photoshop.
I hover the mouse over the tip of the beak in the area of ​​the bright red area.

Hover over the tip of the bird’s beak.

Let’s turn to the panel. Information (Info) in Photoshop to see what it tells us about this point in the image:

Information Panel (Info) Photoshop.

The part that interests us in the panel Information (Info) Photoshop, located at the top left, it shows us the RGB values. The only thing you need to understand is that Photoshop does not display RGB colors as a percentage, that is, we will not see values ​​like “10% red (red) 40% green (green) and 50% blue (blue). ” Instead, RGB has values ​​from 0 to 255, where 0 means the complete absence of the specified color in the image, and 255 indicates that full color is used.

So, if we look at the section that I have selected, we will see that the dot contains the values ​​216 for red (red) (very large), 59 green (green) (fairly small) and 1 blue (blue) (could be 0), which means that at this point there is almost no blue color, and a very small amount of green. The overwhelming majority of color comes from red, which, in general, is natural, since the bird’s beak is definitely red.
Let’s look at another point. I hover over a plot in the back of a bird:

Hover the mouse over a point in the back of a bird.

This section looks green enough for me, and if we see what the panel tells us Information (Info):

The Photoshop Info Panel (Info) shows us the RGB values ​​for a section of an image.

Then we will make sure that green (green) – the dominant color, meaning 180. Red (red) has a value of only 20, which is a very small value, and blue (blue) even less than 16.
Let’s do it again. I will hover over somewhere in the head of the bird:

Hovering the mouse over a point in the area of ​​the bird’s head.

This time, blue should have a higher value in the panel. Information (Info):

The Photoshop Info Panel (Info) showing RGB information for a point selected on a bird’s head..

And again convinced that this time blue (blue) color has a predominant value of 208 and is the dominant color. Of course, the bird’s head is not pure blue. It is more purple-blue, which explains why green (green) is of great importance 100, and even red (red) has a sufficiently large value of 90. All three colors are mixed together on the screen to form the purple-blue color that we see.

I could continue to hover over any point in the photo (I don’t want to, but I could), and we could see how the values ​​change red (red) green (green) and blue (blue) in the panel Information (Info), because each single color in the image consists of a specific combination of these three colors.
This is how the RGB mode works. Repeat, RGB, means nothing more than Red (Red), Green (Green) and Blue (Blue), and since this image is in RGB mode, Photoshop renders each color using combinations of red, green, and blue.
The next thing we look at in the second part of the image – color channels (color channel).

At the moment, we found out that Photoshop does not see color. Everything in the world Photoshop created from black, white and some shades of gray. We also learned that Photoshop uses the RGB color mode to display colors on the screen by mixing various combinations. red (red) green (green) and blue (blue). But how does Photoshop know how much red, green, and blue you need to mix to get a separate color on the screen when it doesn’t know which color it should be? I mean, it’s great that Photoshop can display pure yellow by blending full color. red (red) with a value of 255 as well green (green) with the same value, but how does he know what to display exactly yellow?
The answer is no way. How, in any way?

That’s how. Photoshop does not know that you expect to see yellow in a certain part of the image. He knows only that he is displayed when red (red) with a value of 255 and green (green) with a value of 255, and excludes blue (blue). If this combination creates exactly the color that you and I call yellow, then that’s great, but Photoshop doesn’t stand aside. All he knows is “to display red (red) with a value of 255, green (green) – 255 and blue (blue) 0 at a specific pixel. ” While adding different colors to images, Photoshop is an artist, “coloring figures.”

So, since Photoshop adds a certain amount red (red) green (green) and blue (blue). How does he know how much each color needs to be added, when all he understands is black, white and gray? Two words… Color channels (Color Channels).
Let’s look at the bird image again:

So we see this image with you. This is how Photoshop sees it:

But wait. He also sees it like this:

But how does he see him in two different black and white versions? Good question. The answer is no way. He sees it in three different black and white versions. Here is the third:

Everything that we see in one color image, Photoshop sees in three separate black and white images. Each of these images represents a color channel. The first is the red channel, the second is green, and the third is blue. Three separate channels for three different colors, combined together will create a full color image.

Treat color channels as color filters. While Photoshop displays a color image on the screen, it knows which colors to display due to the brightness of the light passing through the filters. First, it highlights through a red filter (red channel). If the light does not pass through the filter, Photoshop knows that it is necessary to display red with a value of 0. If all the light passes through the filter, Photoshop fully displays red with a value of 255. If the amount of light passing through the filters is slightly less, Photoshop displays red a color with a value between 0 and 255, depending on how much light passes through the filter. Then he does the same with the green filter (green channel), setting it to 0 if the light does not pass through the filter, and 255 if the light passes through the filter completely, and some value between 0 and 255 if a little light passes. Then he does the same with the blue filter (blue channel). After that, he knows with what value to set for red, green and blue, and combines them, creating the color that we see. It does all this for every pixel of your image, so if your image contains millions of pixels, like most photos taken with a digital camera these days, Photoshop does this operation a million times and only to display the image you see. on the screen. See how much Photoshop loves you? So, a second ago, I said that Photoshop does not stand aside. Moving on.
Photoshop “filters” use the three separate black and white images we saw. Red:

 So how does Photoshop use this black and white image as a red filter? Remember how I said that Photoshop attributes red values ​​from 0-255, based on how much light passes through the filter? So, how much light passes through the filter depends on how bright the black and white part of the image is. Any portion of pure black will not allow any light to penetrate, this means that the red value in these areas of the image will be 0. Any of pure white areas will allow the light to penetrate completely, in these areas the red value will be 255. And in the areas with different shades of gray, which are most in the image, passes a certain amount of light, depending on how bright or dark part of the gray is represented.

In the image above, we can see that the brightest parts of the image fall on the beak and chest of the bird, which confirms what I just said: these areas contain more red in the full-color image. As well as the areas of the back, wings and abdomen are very dark, so there should not be much red or completely absent in these areas.
Let’s go back to the full color image:

We said that the beak and chest should contain a lot of red, and as you can see, this is so! We also said that the back, wings and stomach should not contain much red, or it should be completely absent, and I really do not see red on them.
Let’s look again at the black and white image Photoshop uses for the green channel:

This black and white image contains many bright areas, which mean that a lot of green should be present in the photo. It is also strange that one of the brightest areas in the image is near the chest of the bird, but I do not remember that there was a green color. Let’s check this by looking again at the full color image:

On the image, of course, a lot of green, which explains the many bright shades of gray on a black and white image. If I look at the other side of the chest of the bird, which had the brightest spot in the black and white image, then it will not be green. In fact, it is very yellow! How is this possible? Simply. Red and green in combination give yellow, so Photoshop mixed red and green together to display yellow.
Let’s look at another black and white image that Photoshop uses as a blue channel:

This image has a lot of very dark areas, especially on the bird itself, except for the head, which is very light. This should mean that only one part of the bird will be displayed in blue – its head. Although her tummy, too, should have a noticeable amount of blue, so the legs and a piece of wood on which she sits. Let’s get a look:

We made sure that the bird’s head is very blue, we also saw that its tummy, as well as the legs and a piece of wood, are also blue. The rest of the bird has no noticeable blue areas, so the dark areas in the black and white image appeared in these places.
We found out everything about how the RGB color mode and color channels in Photoshop work, all but one thing. We still have not seen where you can access these color channels. You will find them in the appropriately named panel. Channels (Channels), which are grouped with a palette layers (Layers).

Channels Panel (Channels) Photoshop.

Palette Channels (Channels) looks about the same as the palette layers (Layers), only it shows information about color channels (color channels) instead of layers. Here you see one Red (Red), one Green (Green) and one Blue (Blue) channel, and each of them contains its own version of the black and white image, exactly as I showed in this lesson. The topmost channel “RGB” is not really a channel. It’s just a collection of three channels, giving us a full color photo. You can click separately on each channel in the palette. Channels (Channels) to display its black and white image in the document window.
That’s all. We now know that Photoshop sees everything through the prism of black, white and gray. We know that using the RGB mode (in any case, set by default) mixes different amounts of red, green and blue to get the full color image that we see on our screens. And we also know that, depending on how much is red, green and blue, the black and white version of the image of each of the three channels will have its own, that all these operations are done for each individual pixel in the image. And thus, you and I can see the full color version of the image, while Photoshop is content with black and white.
Now we know how Photoshop loves us. This concludes this lesson.

Like this post? Please share to your friends: