Tool Magic wand (Magic Wand) – one of the oldest tools in Photoshop. Unlike other tools that highlight pixels in an image based on the shapes or edges of an object, Magic wand (Magic Wand) highlights pixels based on hue and color. Many people are disappointed in Magic wand (Magic Wand) (by giving it the unfriendly name “terrible wand”), because sometimes it seems that it is impossible to control which pixels you need to select this tool. In this lesson we will look at the magical properties of the tool, and how the wand really works, and also learn how to recognize the situations for which this old, but still incredibly popular, tool was created.
Selection using the Magic Wand tool
If you are using Photoshop CS2 or earlier, you can choose Magic wand (Magic Wand) by simply clicking on it in the toolbar. In Photoshop CS3, Adobe presents the adjacent Magic wand (Magic Wand) tool Fast selection (Quick Selection). Therefore, if you are using a version of CS3 and higher (here I am using Photoshop CS5), you need to click on the tool icon Fast selection (Quick Selection) in the toolbar, hold down the mouse button for a couple of seconds until a drop-down menu appears. Select from the menu Magic wand (Magic Wand):
Magic wand (MagicWand) is located in the group with the Quick Selection tool (Quickselection) in version PhotoshopCS3 and above.
Magic in the wand
Before we consider the action Magic wand (Magic Wand) on a real example, let’s see how the tool works, and that there is no magic in it. Here is a simple image that I created, it consists of a black and white gradient, divided by a transverse red line in the center:
Simple gradient divided by red stripe.
As I already said, Magic wand (Magic Wand) in Photoshop highlights the pixels, relying on the tone and color. When we click on a section of the image with a tool, Photoshop determines the tone and color of the section we clicked on and highlights the pixels that have the same color and brightness values. It does Magic wand (Magic Wand) indispensable for highlighting color on large areas.
For example, let’s assume that I want to highlight a horizontal bar. All I have to do is click somewhere inside the red bar. Magic wand (Magic Wand). Photoshop will see that I clicked on a section of red and immediately select each pixel in the image that has the same shade of red, thereby highlighting the red bar immediately after clicking on it:
A single click by the Magic Wand (MagicWand) – all that is needed to highlight the entire red stripe.
Selecting a monochromatic strip was easy enough, since the image no longer had pixels that had the same shades of red, but let’s see what happens if I click Magic wand (Magic Wand) gradient. I click on the gray area in the center of the gradient over the red bar:
Selected area after clicking on the center of the upper gradient.
This time, Photoshop highlighted the central range of the brightness value, limited by pixels that have exactly the same tone and color as the central gray area I clicked on. Why is that? To find the answer, we need to look at the tool settings panel at the top of the screen. In particular, we need to pay attention to the value of the parameter Tolerance (Tolerance):
Parameter Magic Wand (MagicWand).
Parameter Tolerance (Tolerance) tells Photoshop how different in tone and color can be the pixels that make up the area we chose to include in the selection. Default value Admission (Tolerance) is set to 32, which means that Photoshop will highlight any pixels of the same color as the area we clicked on and add 32 more different shades of different shades and 32 shades brighter to them. In the case of my gradient, which includes 256 levels of brightness between pure white and pure black, Photoshop selected pixels located between 32 shades darker and 32 shades brighter than the gray one I clicked on.
Let’s see what happens if I increase the value Admission (Tolerance) and try again. I will increase the value to 64:
Increase the value of the Tolerance (Tolerance) from 32 to 64.
With Admission (Tolerance), doubled compared to the previous example, if I click Magic wand (Magic Wand) at the same center point of the gradient, Photoshop should highlight the area twice as large as in the previous example, because it includes pixels within 64 shades darker and 64 shades brighter than the main gray color I clicked on. So, here is what we have:
This time, with an increased Tolerance (Tolerance), the gradient area allocated became twice as large.
What if I want to highlight the gradient shade that I click on? In this case, I have to install Tolerance (Tolerance) to 0, which will give the Photoshop command not to include any other pixels in the selection, only those that I have indicated by clicking:
Setting the Tolerance value (Tolerance) to 0.
With parameter set Tolerance (Tolerance) to 0, I will click again on the same point in the center of the gradient, and this time we will get a very thin selection line. Every pixel that has a different tone from the gray I clicked on was ignored:
Increase or decrease the Tolerance (Tolerance) has a great influence on which pixels in the image will be highlighted with the Magic Wand (MagicWand).
You can install Tolerance (Tolerance) to any value between 0 and 255. The higher the value, the wider the range of pixels that Photoshop will highlight. Tolerance (Tolerance) set to 255 will highlight the entire image, so you should usually choose lower values.
Adjacent pixels (Contiguous)
When we considered the parameter settings Tolerance (Tolerance) Magic wand (Magic Wand), you may have noticed one feature. Each time I clicked on the gradient over the red bar, Photoshop selected a certain range of pixels, but only within the gradient that I clicked. The gradient under the red stripe, identical to the gradient I clicked on, was completely ignored, even though it contains exactly the same shades of gray that should have been included in the selection. Why are the pixels from the bottom gradient not included?
The reason for this is another important parameter in the settings panel – Adjacent pixels (Contiguous). With the option checked Adjacent pixels (Contiguous), as set by default, Photoshop will select only those pixels that are among the acceptable ones in the color and color range defined by the parameter Tolerance (Tolerance). Any pixels located within the parameter values. Tolerance (Tolerance), but separated from the area you clicked, pixels that are not included in the specified range will not be selected.
In the case of my gradient, the pixels at the bottom of the gradient, which were supposed to be included in the selection, were ignored because they were separated from the section I clicked with a red stripe, the colors of which do not fall within the limits set by the parameter
Tolerance (Tolerance). Let’s see what happens if I uncheck the option Adjacent pixels (Contiguous).
Adjacent pixels (Contiguous) by default are highlighted. Click inside the box to disable the option, if needed.
I will again click on the center of the top gradient using Magic wand (Magic Wand), and this time, with the unchecked parameter Adjacent pixels (Contiguous), lower gradient pixels that are within the specified parameter value Tolerance (Tolerance) also stand out, even though they are still separated from the site I clicked with a red stripe:
When Adjacent pixels are disabled (Contiguous), any pixels throughout the image that are in the specified tolerance limit (Tolerance) will be highlighted.
Next we look at the effect of some additional parameters of the tool. Magic wand (Magic Wand) on a real example, such as a quick selection and replacement of the sky in the photo!
Tolerance (Tolerance) and Adjacent pixels (Contiguous) – two parameters that have the greatest impact on Magic wand (Magic Wand), but there are a couple of other parameters that have a minor value. As soon as the tool Magic wand (Magic Wand) highlights the pixels, it highlights them in the shape of a quad, a selection can sometimes have uneven jagged edges, often called the “ladder” effect. Photoshop can smooth the edges after applying a light blur to them, this procedure is more commonly known as Anti-aliasing. We can enable and disable tool smoothing. Magic wand (Magic Wand) by checking or unchecking a parameter Smoothing (Anti-alias) in the settings panel. By default, this option is enabled, and in most cases you can leave it enabled.
Leave Smoothing (Anti–alias) included, in order for the Magic Wand (MagicWand) smoothed the edges of the selection.
Also default when you click on the image Magic wand (Magic Wand), it only looks for pixels within the layer you are currently working on. Usually this is how we need to use this tool, but if your document consists of multiple layers and you want to include all layers in your selection, select the option Sample from all layers (Sample all layers) in the settings panel. By default it is not marked:
Leave the Pattern with all layers (Samplealllayers) unchecked to limit your selection within the active layer.
Here is an image that I opened in Photoshop. I like this photo as a whole, but the sky might look more interesting. I am thinking of replacing the sky with something else:
Pure blue sky looks a bit trite.
Moving the sky means that I have to select it first. As I noted earlier, Magic wand (Magic Wand) is distinguished by the allocation of large areas of the same color, and since the sky is pure blue, with only slight variations in tones, Magic wand (Magic Wand) to cope with this task with ease. With the active tool and all its default parameters (Tolerance (Tolerance) 32, Adjacent pixels (Contiguous) is marked), I click somewhere at the top of the image:
Click the Magic Wand (MagicWand) in the upper left side of the sky.
Since the sky is completely blue, Magic wand (Magic wand) there were no problems with its selection after a single click. Despite this, in reality the sky moves from a light blue hue just above the buildings to a darker shade at the top of the photo, and the value Admission (Tolerance) 32 is not high enough to cover the whole range of tonality values, leaving a large stretch of light blue over the buildings outside the selection:
Some bright areas of the sky above the buildings were not included in the selection.
My first attempt to create a sky selection failed because the value Admission (Tolerance) turned out to be too small, I should try to increase the value Admission (Tolerance), but there is an easier way to fix the problem. Like other Photoshop tools, Magic wand (Magic Wand) has an option to “add to existing selections” (add to existing selections), which means that I can save the selection that I made earlier and just add another sky to it.
To add a selection, hold down the Shift key and click on the section you want to add. You will see a small plus sign (+) in the lower left corner of the cursor. Magic wand (Magic Wand), allowing us to understand that the parameter is active “Add to selection”. In my case, holding down the Shift key, I will click somewhere in the sky that was not included in the original selection:
Holding the key Shift, Click on the site you want to add.
Thus, Photoshop will add to the existing selection a new piece of sky. All that was needed was two mouse clicks:
Now the sky is highlighted completely.
Select what is not needed initially.
So, since the sky will change, I need the selection to include an image under the sky, because I want to leave this part. And drawing a selection using tools like Polygonal / Polygonal lasso (polygonal lasso) or Magnetic Lasso (Magnetic Lasso) would take a lot of time and nerves, while Magic wand (Magic Wand) made it easy and simple. Now it is the most popular and very affordable selection technique using Magic wand (Magic Wand) – first we select the area that we don’t want to include in the work, and then just invert the selection!
To invert the selection, which will select everything that was not included in the selection (in my case, everything that is below the sky) and remove the selection from everything that was selected (sky), go to the menu Allotment (Select) at the top of the screen and select Inverse (Invert). Or use a faster way to invert the selection – use the short command on the keyboard Shift + Ctrl + I (Win) / Shift + Command + I (Mac):
Go to the Selection – Invert menu (Select – Inverse).
With the inverted selection, the sky is no longer highlighted, only everything below it in the image is highlighted:
The area I needed to save is now highlighted.
To replace the sky at this stage, I will press Ctrl + J (Win) / Command + J (Mac) to quickly copy the section I saved to a new layer in the layers palette:
The selection was copied to a new layer above the original image.
Then, I will open the image with which I want to replace the original sky. Press Ctrl + A (Win) / Command + A (Mac) to quickly select the entire image, then Ctrl + C (Win) / Command + C (Mac) to copy it to the clipboard:
A photo that will replace the sky in the original image.
I will switch back to my original image and click on the background layer in the layers panel so that when I insert the image, it will appear as a layer between two already existing layers:
Select the background layer.
Finally, I press Ctrl + V (Win) / Command + V (Mac) to paste the image into the document. Everyone loves the blue sky, but sometimes a few clouds can make a greater impression:
The sky has been successfully (and quite easily) replaced.
Like other Photoshop tools, successful use Magic wand (Magic Wand) depends on whether you know in which cases it is better to use this tool. As we saw from the lesson, Magic wand (Magic Wand) is best suited for highlighting a large number of pixels that have similar pitch and color, ideal for highlighting and replacing a simple sky with a photo or for images with an object on a uniform background. Use the technique of “highlight what you originally do not need” in cases where the selection of the area around the object using Magic wand (Magic Wand) can be faster and easier than selecting the object itself using other tools.