How to change line color in photoshop. Ways to change the color of an image or photo in Photoshop. Selecting a color from an image

In this tutorial, we'll learn how to use the Color Matching command to match the color of an object in one photo relative to an object in another photo. This feature appeared in Photoshop, starting with the version of Photoshop CS ( this means that you will need at least Photoshop CS to complete).

Here is an image of the model, taken by me from the catalog. The girl obviously looks very pleased, and besides, the color of her blouse is quite suitable for the colors of the green area in which she is:

original image

Like most clothes, this blouse can be made in other colors. For example, let's say it's also available in the shade shown in this photo:

Model wearing a purple blouse

The client would like you to change the color of the girl's blouse in the first photo to match the color of the blouse in the second photo, like this:

The color of the blouse in the original photo is matched from the color of the blouse in the second photo

Photoshop's Color Matching feature was created specifically for this kind of task, although it has many other uses that we'll cover in other articles. However, depending on the images you're using, Color Matching by itself doesn't always work perfectly.

Sometimes this function does what it's supposed to do, sometimes it doesn't. She often needs a little help, and as we'll see in a minute, this is one of those times. Let's start!

Step 1: Duplicate the background layer of the original image

The first thing we should always do when we start working with an image in Photoshop is to duplicate the background layer. It contains the original image information and we don't want to lose it in case we have to start over. Currently, my layers palette shows that my background is all I have:

The layers palette shows the background layer, which contains the original image information.

All you have to do to duplicate the background layer is use the keyboard shortcut Ctrl + J (Win) / Command + J (Mac) . If we look at the palette again, we can see that we now have two layers - the original background on the bottom, and a copy of it, which Photoshop automatically named " Layer 1«:

The layers palette now shows the background layer, as well as a copy of the background layer above it

Now we can work safely without worrying about damaging the original.

Step 2: Select the object whose colors you want to change

Use a selection tool of your choice ("Lasso", "Pen", etc.), draw a selection around the object whose colors you want to change. I outlined the girl's blouse:

Use the selection tool of your choice to select the object whose colors you want to change

Step 3: Select a large area inside the object in the second image

Now switch to the second image and again using your favorite selection tool ( Lasso is great for this.), select a large area within the object that contains the desired color. In my case, I'll select the section of the purple blouse the girl is wearing.

We don't need to precisely outline the selection around the object at all, but we need to make the source area large enough to include as many shades as possible ( light and dark areas).

Photoshop needs to get as many shades of color as possible so that it can accurately apply the color of the original image to the object ( The buttons on the blouse can pose some problems in certain cases, so I dragged them with the Lasso Tool while holding down the Shift key to subtract them from the selection, just to be on the safe side.):

Choose a large area of ​​the blouse to include as many shades of color as possible.

Step 4: Switch Back To The Original Image

Now that we've selected the subject in the first photo and a large area inside the subject in the second photo, we can apply the Color Picker command. Before we do anything, we need to make sure our original photo is active.

So click anywhere inside the original image to select it. The Color Picker command will refer to this source image as the target.

Step 5: Activate the Color Picker

With the source image selected, go to the " Image" menu, select " Correction"And click" Match color»:

Go to Image > Adjustment > Match Color

The Match Color dialog box opens. And now I want to note that I love Photoshop. But, in all honesty, there's something about the Match Color dialog box that I don't like. It's confusing, and it shouldn't be. So we just have to sort through this confusion to get to the truth.

The Color Picker dialog box is divided into two main parts - " Target image» top and « Image statistics» bottom. You assumed that the bottom section would be called " original image", is not it? But no, it's called Image statistics". Let's just leave the bottom part for now and focus on the top," Target image».

Target image is an image containing the colors we need to change. And there is no way in the dialog box to actually set the target image. Photoshop simply assigns it based on which image you had selected when you opened the Color Picker command.

That's why I first asked you to select a source image before calling the command. My original image is named "green.jpg" and we see it listed next to the word "Target" at the top of the dialog box:

In the Match Color dialog, the photo "green.jpg" is displayed as the target image

Under the heading " Target image» section is located « Image Options”, it contains options such as: “Brightness”, “ Color Intensity"," Weakening "and" Neutralize". It would be logical to assume that since these options are grouped under " Target image”, means they are doing something with the target image.

But they manage the original image at the bottom which is called " Image statistics". Now do you understand what I'm talking about? This dialog needs some work.

Although the dialog box itself is a little confusing, what we can do with it is quite clear. We already have " Target image”, which we selected before running the command. So now we need to select the source image.

Step 6: Choose The Second Image As Your Source

Below, in the section Image statistics" you will see an option called " Source" with a drop-down list. Select the second image from the list to set it as the image source:

Select the second image from the "Source" drop-down list

If your " original image" contains several layers, you need to select the appropriate layer using the "Layer" option located below the "Source" option. In my case, the second image contains only one layer, the original background, so it is automatically selected.

Step 7: Tell Photoshop To Use The Selection You Made On The Images

Directly above the parameter " Source"There are two options with checkboxes next to them - "" and "". The first option tells the program that we want to use only the colors of the selected area of ​​the original image when selecting.

In other words, in my case, I only want to use the purple colors that I highlighted on the girl's blouse. If I didn't do this, it's understandable that Photoshop would ignore my selection and use the colors from the entire image. Which, of course, we don't need, so make sure you check the box for this option.

The second option tells Photoshop that we only want to color match the specific object we selected in the original image. In my case, this means that I want Photoshop to only consider the colors of the girl's blouse.

If I didn't specify this, Photoshop would take all the colors in the photo into account, and the end result wouldn't be as accurate. So make sure this option is also checked:

Highlight the options " Use Selection in Source to Calculate Color Value" and " Use Selection in Target Image to Calculate Correction” to tell the program to use only selected areas of images when matching colors.

Click the OK button to exit the dialog box and let Photoshop try to match colors for the target image based on the colors in the source image. In many cases this works fine and nothing else needs to be done.

But sometimes Photoshop fails to pick up the colors correctly. This is just one of those cases. This is what my original image looks like now ( selection remains visible and active):

Original image after using Match Color

Photoshop managed to pick up the primary colors, however, in general, something is wrong with the effects. The problem is that the blouse area has completely lost contrast. The dark areas look too light, the highlighted areas have completely disappeared. In general, everything looks unnatural. This is one of those cases where the Color Matching feature needs a little help.

I could try to adjust the brightness by moving the "Brightness" slider in the " Image Options» of the Match Color dialog box, but all I can do with it is make everything lighter or darker. I need to be able to adjust light and dark areas separately.

Step 8: Add A Levels Adjustment Layer

I'm going to use a simple Levels Adjustment Layer to darken the dark areas and lighten the light areas on the blouse. To do this, click on the icon New adjustment layer» at the bottom of the layers palette:

Click on the New Adjustment Layer icon at the bottom of the Layers palette

Then select from the "Levels" list:

Choose from the "Levels" list

Step 9: Drag The Black And White Point Sliders Towards The Center

In the dialog box that appears, you will see a large black bar graph ( looks like a mountain). It will contain three small sliders - a black slider on the left, a white one on the right, and a gray one in the middle. To darken dark areas, simply click on the black slider and drag it to the right until it is at the point where the left side of the histogram starts.

Keep an eye on the image in the document window as you move the slider so you can see what's happening with the shadows. Move the slider until you get the desired effect. Then, when you've adjusted the dark areas, click on the white slider and drag it to the left, to the point where the right side of the histogram starts.

Color replacement is a very simple, but extremely useful and interesting feature of Photoshop (Photoshop). You can change colors on an existing image/object both automatically and manually. The automatic method saves time and allows you to quickly repaint a contrasting object, even if it has a complex texture. Manual mode is used when a high-quality result is needed on a complex picture with low contrast.

In this tutorial, we will figure out how to replace a color in Photoshop with another one using 3 different methods.

1 method: change the color of a simple object

To simplify the process, you can use automatic algorithms from Adobe. Built-in function called "Replace Color", she is "Replace Color", in the Russian version, will do everything herself.

Let's analyze the tool on a simple, one-color image.
Open the file with a simple drawing in Photoshop.

Let's change the color of the object to another one we need. Click on the tab "Image", select the item "Correction", farther - "Replace Color".

A window will open allowing you to select and change the color. Activate the tool "Pipette" and capture the color that needs to be replaced with it. Part of the window "Isolation" the automatically generated object mask is displayed. The part of the image in which the color will be replaced is highlighted in white.

Slider "Scatter" allows you to precisely set the boundaries of the image where the color palette will change.

At the bottom of the window is a sub-item "Replacement". This is where the existing color is changed to a new one. Let's set the color we are interested in. The result can be adjusted with sliders "Color tone", "Saturation" and "Brightness".

To apply the changes, click "OK" and enjoy the finished image.

Method 2: change the color of the car

This method is almost identical to the previous one in terms of the algorithm of work, but to reveal all the intricacies of the work, let's take an image with a more complex color scheme. This image has midtones, highlights, and shadows. We chose a photo of the car:

The first step is to explain to the program which color to change. To do this, in the tab "Isolation" choose "Color Range".

With the active tool, click on the part of the image (yellow in our case), which we will change. In the preview window, you can see how Photoshop created the mask based on our selection.

We expose the slider "Scatter" to such a value that all the necessary details of the image fall into the masked area and press "OK". You should get a neat selection of the desired area.

Now let's go to the menu "Image", select the item "Correction""Hue/Saturation".

In the lower right corner, check the box next to the item "Toning". This will allow you not to lose chiaroscuro when painting the image with a new color. Further regulators "Color tone", "Saturation", "Brightness" we achieve the desired color.

After achieving the desired result, press the button "OK" and enjoy the result.

Method 3: Change hair color in Photoshop

Part of the image with a complex texture, such as eyes or hair, is easiest to recolor manually using a special adjustment layer.
Open the selected image / photo (we chose the photo of the beautiful Natalie Portman) in Photoshop.

Then create a blank layer on top of the original. Change "Overlay Mode" on the "Chroma"

Select the desired color on the palette:

Then the instrument "Brush" paint over the desired areas of the image.

It's okay if you accidentally climb on the wrong area when painting. Tool "Eraser" with a hardness of 15-20%, carefully remove all flaws.

After you have painted over the entire area of ​​Portman's unique hair, you need to move the fill slider from 100% to 40% to make it look more and more natural.

This method is the most labor-intensive, but allows you to achieve natural color on complex objects, such as eyelashes and tree leaves. Now let's compare the initial photo of Natalie Portman with our final processed version.

11.02.2015 27.01.2018

In this tutorial, I will tell you in detail about how to change the color in Photoshop. I will sign all the steps in detail, accompany with pictures so that it is clear and intelligibly explain where and what function can be used.

1 way

The first way to replace the color is to use the ready-made function in Photoshop "Replace Color" or Replace Color in English.

I will show on the simplest example, on a simple picture. Take the icon and open it in Photoshop.

Trowel on yellow color icon. We will replace the yellow color with any other color that interests us. To do this, go to the menu Image – Correction – Replace Color (Image – Adjustments – Replace Color)

The color replacement dialog box appears. Now we have to specify what color we will change, to do this, activate the Eyedropper tool (see arrow) and click on the master with it. You'll see this color appear in the dialog box at the top, which is labeled Selection.

At the bottom heading Replacement - there you can change the selected color. But before that, you can set the Scatter in Selection option. The larger the setting, the more it will capture colors. In this case, you can set it to the maximum. It will capture all the yellow in the image.

Set the Color Replacement options to the color you want to see instead of the one being replaced. I made it green by setting Hue, Saturation and Lightness.

When you're ready to change the color, click OK.

So we changed one color to another.

2 way

The second method according to the scheme of work can be said to be identical to the first. But we will consider it on a more difficult image.

For example, I chose a photo with a car. Now I'll show you how to change the color of a car in Photoshop.

As always, we need to specify what color we will replace. To do this, you can create a selection using the color range function. In other words, select an image by color.

To do this, go to the menu Selection – Color range (Select – Color Range)

Then it remains to click on the red color of the car and we will see the function determined it - painting it with white in the preview window. White color shows which part of the image is selected. The spread in this case can be adjusted to the maximum value. Click OK.

After you click OK, you will see how the selection was created:

Now you can change the color of the selected image. To do this, use the function – Image – Correction – Hue / Saturation (Image – Adjustments – Hue / Saturation)

A dialog box will appear.

Immediately check the Toning option (bottom right). Now using the Hue, Saturation and Brightness options, you can adjust the color. I set the color to blue.

All. The color has changed.

It was - became:

In this Photoshop tutorial, I will tell you all about the Color Replacement Tool. This tool is able to change the color of an image object without too much fuss and hassle.

You may be surprised that there are many similarities between the Background Leaf and Color Replacement tools, even though they seem to be completely different tools in their purpose. Both of these tools use the same technique to detect pixels in an image that need to be changed. The only difference is that the Background Eraser removes those pixels, while the Color Replacement tool changes their color to a different one.


The Color Replacement tool does not use the most professional tint option and may not always give you the results you want. But it's good for simple tasks like changing the saturation and hue of objects. Let's see how it works in practice.


(Color change) was first introduced in Photoshop CS, and if you're working in Photoshop CS or CS2, you can find it in the group along with the Healing Brush tool (Healing Brush). Press and hold the healing brush icon in the toolbar (Healing Brush) to select the Color Replacement tool from the drop-down list (Color Replacement Tool).

If you have Photoshop CS3 or CS4, like I do, click on the icon of the Brush tool (brush) and hold it until a drop-down list of other tools in the group appears, select "Color Replacement".



Once selected, the cursor will change to a circle with a cross in the center. The background eraser has the same cursor shape.



It is convenient to adjust the brush size using the square brackets [ or ]. The left parenthesis decreases the size, the right parenthesis increases it. To adjust the hardness (hardness) brushes, add a Shift keystroke (Shift+Left Bracket makes the edges soft, Shift+Right Bracket makes the brush harder).


When you drag the Color Replacement Tool on your image, Photoshop continuously scans the color swatch currently under the cursor cross. This is the color that will be replaced with the current foreground color. (Foreground). Other pixels included in the area of ​​the circular cursor also undergo a color change as it moves over the object.


For example, if you place the cursor on the object's blue color and the foreground color is red, then the color under the cursor will change to red in the cursor area. In the top menu, you can customize how the tool works in different ways, but we'll cover those details later.


The foreground and background colors icon is located at the bottom of the toolbar. By default, the program's foreground color is black.



To change the foreground color, click on the top square (color sample) and choose any new color from the color palette. I will choose green. Click OK when done, closing the palette.



If you look again at the foreground and background colors icon, you will see that the top square is now the color you chose. (mine is green). Now if I paint on the image with the Color Replacement tool (Color Replacement Tool), then the original color will be replaced by the foreground color (green).



For example, let's take a photo of a girl with a balloon.



She is happy but wants her balloon to be green. What can we do for this? Select the Color Replacement tool and, by clicking on the ball, start moving inside it. Since the foreground color is green, the ball's blue color will change to green when the cursor is dragged inside the object.



We continue to change the color of the ball, keeping the mouse button pressed while moving the cursor, until we paint over the entire ball.



If suddenly you went beyond the boundaries of the object being processed (ball) and touched a nearby area, the Color Replacement tool (Color Replacement Tool) these pixels will also change to green.



If you accidentally overflow the object, simply undo the previous step by pressing Ctrl + Z on the keyboard, or undo several previous steps by pressing Ctrl + Alt + Z.

Tolerance/Tolerance (tolerance).

Everything seems to be going well until it comes to handling the edges of the object. If you look closely, you will notice that the edges of the ball are not completely closed, a blue stripe is noticeable.



At the beginning of the tutorial, I mentioned that the Color Replacement tool has various options that you can adjust in the top settings panel. One of these parameters is Tolerance or Tolerance. (tolerance). Tolerance determines how sensitive the tool is to the color being replaced. By default, the program has a tolerance of 30% for the Color Replacement tool, but this is clearly not enough for our case. Let's increase it to 50%, which will allow us to influence a wider range of colors, and again draw along the edges of the balloon. Now these areas have also been changed completely to foreground green.




I'll finish up the other areas of the balloon by increasing the Tolerance value a little more. (tolerance). Here is a magical transformation.


Picking a color from an image.

In the previous example, I chose the foreground color for the balloon using the color palette. But, you can choose a color sample from the elements of the image, for example, a girl's blouse. To do this, with the "Color Replacement" tool active (Color Replacement Tool), press the Alt key and your cursor changes to an eyedropper (Eyedropper Tool).

Now, click with the eyedropper on any area of ​​the photo whose color you want to sample for future replacement. Look at the foreground and background colors icon, and you will notice that the top square has taken on exactly the color you chose.


I liked the pink color of the blouse, I will choose it.




Now, I'll run the tool over the balloon again so that it turns pink.



Note the significant benefit of the Color Replacement tool (Color Replacement Tool) in front of the regular brush (brush). After all, by changing the color, the ball retains its volume, texture and the ratio of light and shadow, which would be impossible when using the Brush (brush). The object would just become flat with normal painting.

Blend Modes (Blend Modes).

The reason the tool is able to change the color of an object without losing its texture is due to the use of different blending modes. The superimposed color interacts with the previous color and this effect is obtained. You can see these modes in your top settings menu, there are four of them: hue, saturation, color and brightness (Hue, Saturation, Color, and Luminosity). By default, the program is set to Color mode. (Color)



If you have ever read about color theory, then you know that color is a combination of three components: hue, saturation, and brightness. You can choose any blending mode depending on which of these three aspects of the original color will be affected.


Mode "Tone" (hue): Only the base color itself will change, leaving the saturation and lightness unchanged. This mode is suitable for images where the color is not very intense, as the changes are quite subtle.


Saturation Mode (Saturation): Only saturation changes, hue and brightness do not change. This mode is useful for reducing color intensity or removing color completely.


Color Mode (Color): Set by default and changes hue with saturation. The brightness remains unchanged. Usually used more often than other modes.


Brightness Mode (Luminosity): Changes the brightness of the original color to the overlay. Hue and saturation do not change.


For the next example with blend modes (Blend Modes) I chose again the photo with balloons. In the picture, the orange ball seems to be striving to fly above all the others, let's work with it.



One way to make the ball stand out from the rest of the group is to de-saturate the rest of the balls. In the Blending Modes tab, I'll choose the "Saturation" mode. (Saturation).



If I wanted to completely discolor the balls, then I would choose white, gray or black as the main color. But I want the effect to be more subtle. To do this, I'll sample the color from the less bright bulb by holding Alt and clicking with the eyedropper (Eyedropper Tool) on him. Why am I sampling the yellow ball when I'm going to work with the orange one? The fact is that I need a sample of exactly the saturation of the object, and not its hue. With blending mode "Saturation" (Saturation) only the saturation will change, not the tone of the processed ball.



Now, with the Color Replacement tool selected, we start painting on those balls on which we want to reduce the saturation level, making them paler than usual. Adjusting the brush size (square brackets), if necessary, and the level of tolerance. In the example below, you can see how different the initial shade of the ball is from the changed one.



We continue to paint over all the balls to select the top one.


Brightness Issues (brightness).

There are some difficulties using the Color Replacement tool (Color Replacement Tool) in cases where there is a large difference between the brightness of the original color and its replacement. Let's say I wanted to change the hue of the top orange ball to the purple color of another ball in the bunch. Everything, it would seem, is simple enough? But…


First, let's return all the colors of the balls to their original state. To do this, go to the File-Checkout menu. (File Revert). Now, let's sample the color from the purple ball by Alt-clicking on it to switch to the eyedropper.



In the top menu, set the blending mode to "Color" (Color) default. Next, I will paint over the orange ball to change its color to purple. Here is the result:



Hmm... It's purple, of course, but its hue doesn't match the other purple balls in the bunch. The problem is that our orange balloon is much brighter than the purple balloons. Our set blending mode does not affect the brightness, it only affects the color.


Let's try to make our ball brighter by changing the blending mode of the Color Replacement Tool to Luminosity. (Luminosity).



I reversed the previous steps to return the ball to its original orange color. Now, with the "Luminance" blend mode (Luminosity) paint the ball with a dark purple color.



Well! Everything didn't go the way we wanted. The Brightness mode made the ball brighter, of course, but it's still orange and the texture of the object is gone. The problem here is that there is too much difference in brightness between objects. The Color Replacement tool works great for simple tasks where you just need to change the hue or saturation of a color, but if there is too much difference between the brightness of two elements of an image, then you need to choose other methods.



In the top menu, you can see three pipette icons. Each of the three options represents a specific way to select a color swatch to work with. (Sampling). Let's list them from left to right: sample: continuously (continuous), it is set by default of the program; test: once (Once); sample: sample background (Background Swatch). To switch between the three options, simply activate the selected icon.



Let's consider these options in more detail.


Sample: continuous (continuous). With this option, the color selection will be performed by the tool continuously while you hold down the mouse button and move the cursor over the image. This option is good when you want multiple, complex color changes on an object.


With a single test (Once) Photoshop respects the color selected once with a mouse click, no matter how long you move the cursor over the image. This setting is best for replacing large areas of uniform color.


background sample (Background Swatch). You won't use this setting very often. Here the background color replaces the original one. Only those pixels that match the background color will be replaced on the image, so you need to select the shade in the color palette that best matches the color of the image by clicking on the lower square of the foreground and background color icon. Try adjusting the tolerance value if your hue isn't quite close to the original.



The next option in the Color Replacement tool's settings controls the location of the replaced pixels and is called Constraints. (Limits). This option has three color detection options: adjacent pixels (Contiguous), non-adjacent (discontinuous) and edge selection (Find Edges).


Of the three that exist, you will often use the first two.



By default, the program is set to the adjacent restriction type. (Contiguous). With this type of restriction, the Color Replacement tool (Color Replacement Tool) recolors the pixels that are within the cursor, namely under the cross. The effect of the tool will not affect in any way those pixels that correspond to the selected color, but are separated from the cursor by an area of ​​a different color. Of course, unless you physically move the cursor to these zones.


Constraint type nonadjacent (discontinuous) replaces all pixels within the tool's cursor.


The last type of edge selection (Find Edges) replaces the color in areas with a tint of the selected color, preserving the outline of the edges of the object.


And, the last option in the top settings menu of the Anti-Aliasing tool is (anti-aliasing). Activate it if you need smooth edges of the image, if you want the exact outlines of the object, on the contrary, uncheck the box.



That's probably all I wanted to tell you about this essential tool. I hope that the skills in working with "Color Replacement" will be useful to you more than once.

Replacing colors in Photoshop is a simple but fun process. In this lesson, we will learn how to change the color of various objects in the pictures.

We will change the colors of objects in three different ways. In the first two, we use the special functions of the program, and in the third, we paint the desired areas manually.

Method 1: Simple replacement

The first way to replace colors is to use a predefined function in Photoshop "Replace Color" or "Replace Color" in English. It shows the best result on solid objects. For example, let's take an icon and open it in Photoshop. Next, we will replace the color with any other we are interested in.


So we changed one color to another.

Method 2: Color Range

The second method, according to the scheme of work, can be said to be identical to the first. But we will consider it on a more difficult image. For example, we chose a photo with a car.

As in the first case, we need to specify which color we will replace. To do this, you can create a selection using the color range function. In other words, highlight the image by color.

The result has been achieved. If areas of the original color remain on the image, the procedure can be repeated.