Difference between revisions of "Selection to Mask Workflow"

From Photoshop
Jump to: navigation, search
(Clamping and dilate / erode)
(Overview)
 
(20 intermediate revisions by the same user not shown)
Line 3: Line 3:
  
 
==Overview==
 
==Overview==
The selection to mask workflow is, in principle, simple enough.
+
The selection to mask workflow is, in principle, simple enough. Here is the general workflow:
Selecting can not be separated from masking. Here is the general workflow:
 
  
  
Line 11: Line 10:
 
  ! Stage  !! Task
 
  ! Stage  !! Task
 
  |- style="vertical-align:top;"
 
  |- style="vertical-align:top;"
  |[[#Review  | Review]]
+
  | style="width: 200px;" | [[#Review  | Review]]
  |Review the image to determine what region needs to be masked, and if this region is naturally defined by a single color.  
+
| style="width: 400px;" | Review the image to determine what region needs to be masked, and if this region is naturally defined by a single color.  
 
  |- style="vertical-align:top;"
 
  |- style="vertical-align:top;"
 
  |colspan="2" style="text-align:center;" | [[File:arrow_down.png|25px]]
 
  |colspan="2" style="text-align:center;" | [[File:arrow_down.png|25px]]
  |- style="vertical-align:top;"  
+
  |- style="vertical-align:top;"
 
  |[[#Select | Select]]
 
  |[[#Select | Select]]
 
  |Select the region.
 
  |Select the region.
Line 26: Line 25:
 
  |colspan="2" style="text-align:center;" | [[File:arrow_down.png|25px]]
 
  |colspan="2" style="text-align:center;" | [[File:arrow_down.png|25px]]
 
  |- style="vertical-align:top;"
 
  |- style="vertical-align:top;"
  |[[#Edit the mask (removing junk) | Edit the mask (removing junk)]]
+
  |[[#Edit non-bordering regions | Edit non-bordering regions]]
  | rowspan="4" | The mask that you have just created will almost certainly require editing: refining and correcting. There are separate process for removing junk, editing soft and hard masks and painting.  
+
  | rowspan="4" | The mask that you have just created will almost certainly require editing: refining and correcting.  
 +
 
 +
There are separate process for removing junk, editing soft and hard masks and painting.  
 
  |- style="vertical-align:top;"
 
  |- style="vertical-align:top;"
  |[[#Edit the mask (refining soft edges) | Edit the mask (refining soft edges)]]
+
  |[[#Edit hard edges | Edit hard edges]]
 
  |- style="vertical-align:top;"
 
  |- style="vertical-align:top;"
  |[[#Edit the mask (refining hard edges) | Edit the mask (refining hard edges)]]
+
  |[[#Edit soft edges | Edit soft edges]]
 
  |- style="vertical-align:top;"
 
  |- style="vertical-align:top;"
  |[[#Edit the mask (painting) | Edit the mask (painting)]]
+
  |[[#Edit by painting | Edit by painting]]
 
  |}
 
  |}
  
 
==Review==
 
==Review==
 
At this stage, you should review the image to determine exactly where the mask is to be located. Is the object, or its background, defined by a single flat color? If yes, then you are in luck. This will make the whole process easier.  
 
At this stage, you should review the image to determine exactly where the mask is to be located. Is the object, or its background, defined by a single flat color? If yes, then you are in luck. This will make the whole process easier.  
 
  
 
==Select==
 
==Select==
Line 45: Line 45:
 
{|
 
{|
 
|valign="top"|
 
|valign="top"|
[[File:select_01.png|thumb|none|300px|Here the sampled color is the greenish background. The selected region is visualized as white in the preview. The 'Fuzziness' value is too low for this image, and the selected region is very 'noisy'.]]
+
[[File:select_01.png|thumb|none|500px|Here the sampled color is the greenish background. The selected region is visualized as white in the preview. The 'Fuzziness' value is too low for this image, and the selected region is very 'noisy'.]]
 
|valign="top"|
 
|valign="top"|
[[File:select_02.png|thumb|none|300px|Here the 'Fuzziness' value is very high. See how the edge of the face is now selected. This over-selection would create problems later on.]]
+
[[File:select_02.png|thumb|none|500px|Here the 'Fuzziness' value is very high. See how the edge of the face is now selected. This over-selection would create problems later on.]]
 
|}
 
|}
  
 
{|
 
{|
 
|valign="top"|
 
|valign="top"|
[[File:select_03.png|thumb|none|300px|Here the 'Fuzziness' value is as good as it can be at this stage. The face is not overly selected. However, the region behind the boy's shoulder is dark, indicating the it is under-selected .]]
+
[[File:select_03.png|thumb|none|500px|Here the 'Fuzziness' value is as good as it can be at this stage. The face is not overly selected. However, the region behind the boy's shoulder is dark, indicating the it is under-selected .]]
 
|valign="top"|
 
|valign="top"|
[[File:select_04.png|thumb|none|300px|Here the 'Add to Sample' button has been pressed, and clicked on the area behind the shoulder. This adds to the selection, improving the mask. ]]
+
[[File:select_04.png|thumb|none|500px|Here the 'Add to Sample' button has been pressed, and clicked on the area behind the shoulder. This adds to the selection, improving the mask. The 'OK' button may now be pressed.]]
 
|}
 
|}
  
 
==Make mask==
 
==Make mask==
Press the '''Add Layer Mask''' at the bottom of the [[Layers]] Palette. This will make a [[Layers | Layer Mask]] from the selection. Depending on what you have selected and what you wish to mask, it might be that the mask you are now looking at will require inverting ('''Command I''').
+
With the selection made, press the '''Add Layer Mask''' button at the bottom of the [[Layers]] Palette. This will make a [[Layers | Layer Mask]] from the selection. Its possible that the mask will now require inverting. Simply 'Command i' whilst in the layer mask.
  
[[File:select_05.png|thumb|none|300px|The 'Add Layer Mask' at the bottom on the Layers Pallet.]]
+
[[File:select_05.png|thumb|none|500px|The 'Add Layer Mask' at the bottom on the Layers Pallet.]]
  
Its possible that you now have the perfect mask. However, most likely, the mask will require editing. To get a better idea of how good your mask is, 'Alt click' on the mask in the Layers Pallet. In this case, the face needs some editing.   
+
Its possible that you now have the perfect mask. However, most likely, the mask will require editing. To get a better idea of how good your mask is, 'Alt click' on the mask in the Layers Pallet. This will show the mask in the window. In this case, the face needs some editing.   
  
[[File:select_06.png|thumb|none|300px|Alt click on the mask in the layers Pallet to reveal the mask.]]
+
[[File:select_06.png|thumb|none|500px|'Alt click' on the mask in the layers Pallet to reveal the mask in the window.]]
  
To 'stress test' the mask, press 'Command L' to summon the [[Levels]] adjustment. Move the middle slider (the 'gamma' to either side. This reveals any flaws in the mask. This temporary adjustment is only for testing purposes. Do not press the 'OK' button. This test is known as a 'Gamma Slam'. Moving the gamma slider to the left will test the black of the mask, and to the right the white of the mask. In this case, the background looks a bit noisy... however, the background is probably good enough to require no more work.  
+
To 'stress test' the mask, press 'Command L' to summon the [[Levels]] adjustment. Move the middle slider (the 'gamma') to either side. This reveals any flaws in the mask. This ''temporary'' adjustment is only for testing purposes. Do not press the 'OK' button. This test is known as a 'Gamma Slam'. Moving the gamma slider to the left will test the black of the mask, and to the right the white of the mask. In this case, the background looks a bit noisy... however, the background is probably good enough to require no more work.  
  
[[File:select_07.png|thumb|none|300px|A gamma slam showing up the noise in the mask.]]
+
[[File:select_07.png|thumb|none|500px|A gamma slam showing up the noise in the mask.]]
  
 
==Edit the mask==
 
==Edit the mask==
 
Having made the preliminary mask you now need to get rid of the obvious noise and imperfections. The white 'keep' area of the mask is called the '''holdout''' and the black 'remove' section is called the '''junk'''. Both might require attention.
 
Having made the preliminary mask you now need to get rid of the obvious noise and imperfections. The white 'keep' area of the mask is called the '''holdout''' and the black 'remove' section is called the '''junk'''. Both might require attention.
  
===Non bordering regions===
+
===Edit non-bordering regions===
 
Editing regions of the mask that do not include any border is simple. Just painting them out with a brush. In the case below, the girls face does not include any border.
 
Editing regions of the mask that do not include any border is simple. Just painting them out with a brush. In the case below, the girls face does not include any border.
  
[[File:select_08.png|thumb|none|300px|The imperfections in the mask of the girl's face do not include any border.]]
+
[[File:select_08.png|thumb|none|500px|The imperfections in the mask of the girl's face do not include any border and can easily be painted out.]]
  
Alternately, the 'Set Black Point' technique can be used. Both the [[Levels]] and [[Curves]] adjustments feature a 'Set Black Point' button.  
+
===Edit hard edges===
 
+
For refining a hard edge object, [[Clamping]] may be employed.
{{Template:Set_Black_White_Point}}
 
  
===Refining hard edges===
 
For refining a hard edge object, [[Clamping]] may be employed. 
 
 
{|
 
{|
 
|valign="top"|
 
|valign="top"|
[[File:select_09.png|thumb|none|300px|Here the edge of the boy's shoulder is showing a white brings when placed against a black background (n.b. it might look perfect ok against a white background). ]]
+
[[File:select_09.png|thumb|none|300px|Here the edge of the boy's shoulder is showing a white fringe when placed against a black background (n.b. it might look ok against a white background). ]]
 
|valign="top"|
 
|valign="top"|
[[File:select_10.png|thumb|none|300px|To make the clamp work more effectively, a slight blur has been applied to the edge using the [[Blur Tool]].]]
+
[[File:select_10.png|thumb|none|300px|To make the clamp work more effectively, a slight blur has been applied to the edge using the [[Tools#Blur.2C_Sharpen.2C_Smudge | Blur Tool]].]]
 
|valign="top"|
 
|valign="top"|
 
[[File:select_11.png|thumb|none|300px|Here a [[Levels]] adjustment has been applied. By moving the sliders around, the edge can be softened, hardened and/or moved.]]
 
[[File:select_11.png|thumb|none|300px|Here a [[Levels]] adjustment has been applied. By moving the sliders around, the edge can be softened, hardened and/or moved.]]
 
|}
 
|}
  
===Test the mask===
+
===Edit soft edges===
As you proceed, you will need feedback on how clean or noisy your mask is. A mask can be 'tested' by placing the masked layer on top of a black, white or colored layer (depending on the masked color value). Any defects should will up more clearly.  
+
In the masking of a figure, the hair will require a very soft mask. The problem is that any severe adjustment to a mask is likely to damage these soft regions. Therefore, in the example case of the image of the boy, any edit to the hard-edged cloth will damage the hair.  
  
Another way of testing it is to do a '''Gamma Slam'''. Here it is:
+
There is a way of combining a junk and holdout adjustment in such a way as to leave the bordering edges untouched. However, it is for advanced users. Details are here: [[Dilate Erode Combine]].
  
The black area of the mask below looks fine.
+
For newbies, the simplest approach is to first make a 'pre-selection'  using a [[Tools#Lasso_Selection | Lasso]] or [[Tools#Marquee_Selection | Marquee]]. This should encompass only the hard-edged regions. By doing so, any edit made to the mask will not include its soft-edged regions.
  
[[File:selecting_02.png | 200px]]
+
===Edit by painting===
 +
For painting into tight regions of the mask, the cutting-in method may be used:
 +
{{Template:Cutting In}}
  
However, an extreme [[Curves]] adjustment like the one below will convert the grays into white (I have emphasized the curve in red for clarity).  
+
==Layer Clipping and Masking==
 +
In the example below, the hair of the masked girl has a white fringe. This cannot be fixed using a clamp as it would damage the softness of the hair. Instead it is fixed after the mask process is complete. This is done by first [[Key_Technical_Skills#Clipping | clipping]] a layer to the masked layer. Then, using a [[Tools#Clone | Clone Tool]], the hair is patched. Remember to set the 'clone sample mode' to 'Current & Below'.
  
[[File:selecting_03.png | 300px]]
+
{|
 
+
|valign="top"|
A curve running in the oposite way will convert all the grays into black, therby showing all the defects in the white area.  
+
[[File:select_13.png.png|thumb|none|500px| Here the edge of the girl's hair is showing a white fringe when placed against a black background (n.b. it might look perfect ok against a white background).]]
 
+
|valign="top"|
[[File:selecting_04.png | 300px]]
+
[[File:select_12.png.png|thumb|none|500px|On a clipped layer, some hair is patched onto the white fringe.]]
 
 
'''Ultimate Test''': the ultimate test is, of course, to use it in your composite. A mask will often need tweaking as the composition develops and your sense of what is required in it matures.
 
 
 
 
 
{| style="color:black; background-color:yellow;" width= "100%" cellpadding="10" cellspacing="0" border="1"
 
|The hard edge mask should now be finished and good to go. A soft selection subject (hairy head, fur etc) might require both a hard mask and a soft mask and some sort of way to combine them.
 
 
|}
 
|}
 
+
 
==Soft edge masking==
+
== Miscellaneous Observations==
{{Template:Dilate Erode Combine}}
+
The following are some miscellaneous observation reading the art and craft of masking.
 
 
==Things to remember==
 
  
 
===Masking as drawing===
 
===Masking as drawing===
 
Masking is a drawing activity. Organic shapes in particular can be subject to a lot of creative refinement in the process of masking. In the before (left) and after (right) below the shape of the girl has been clarified and the unfortunate wiggly pattern on the outline of her right sleeve has been removed.
 
Masking is a drawing activity. Organic shapes in particular can be subject to a lot of creative refinement in the process of masking. In the before (left) and after (right) below the shape of the girl has been clarified and the unfortunate wiggly pattern on the outline of her right sleeve has been removed.
  
[[File:selecting_05.png | 300px]]
+
[[File:selecting_05.png | 500px]]
 
 
  
 
===Where are you?===
 
===Where are you?===
 
Whilst masking, be aware of where you are. After having made the mask from a selection you will be taken automatically to the mask component of the layer ('''B''').  Any painting or filling will be done to the mask. If you accidentally navigate to the layer contents component then you may well accidentally painting into the layer contents component of the layer ('''A'''). This is a '''BAD''' thing. '''Option Click''' on the mask to get into and out of it.  
 
Whilst masking, be aware of where you are. After having made the mask from a selection you will be taken automatically to the mask component of the layer ('''B''').  Any painting or filling will be done to the mask. If you accidentally navigate to the layer contents component then you may well accidentally painting into the layer contents component of the layer ('''A'''). This is a '''BAD''' thing. '''Option Click''' on the mask to get into and out of it.  
  
[[File:selecting_01.png | 200px]]
+
[[File:selecting_01.png | 400px]]
 
 
===Negative to positive cutting in===
 
{{Template:Cutting In}}
 
  
 
==See also==
 
==See also==

Latest revision as of 13:34, 2 July 2016

Selecting is a key aspect of the compositing workflow and one that is not without a good deal of complexity. There are many selection tools, many reasons to select and many things you should know about it. In the compositing skill-set selection is most vital when it is used in order to separate a figure or object from its background and it is in this context that I shall adress it. If you get good at this then all other selecting tasks shall seem trivial.


Overview

The selection to mask workflow is, in principle, simple enough. Here is the general workflow:


Stage Task
Review Review the image to determine what region needs to be masked, and if this region is naturally defined by a single color.
Arrow down.png
Select Select the region.
Arrow down.png
Make the mask Press the mask button. This will automatically make a mask based on the selection.
Arrow down.png
Edit non-bordering regions The mask that you have just created will almost certainly require editing: refining and correcting.

There are separate process for removing junk, editing soft and hard masks and painting.

Edit hard edges
Edit soft edges
Edit by painting

Review

At this stage, you should review the image to determine exactly where the mask is to be located. Is the object, or its background, defined by a single flat color? If yes, then you are in luck. This will make the whole process easier.

Select

At this stage, you simply make the selection. This you do using one of the selection tools. For a hard edge object the Quick Selection tool is sufficient. For regular objects like boxes, buildings etc the Polygonal Lasso Tool is a good choice. For things like hair the Select / Color Range is the only option. Using the Color Range is simple, but also critical.

Here the sampled color is the greenish background. The selected region is visualized as white in the preview. The 'Fuzziness' value is too low for this image, and the selected region is very 'noisy'.
Here the 'Fuzziness' value is very high. See how the edge of the face is now selected. This over-selection would create problems later on.
Here the 'Fuzziness' value is as good as it can be at this stage. The face is not overly selected. However, the region behind the boy's shoulder is dark, indicating the it is under-selected .
Here the 'Add to Sample' button has been pressed, and clicked on the area behind the shoulder. This adds to the selection, improving the mask. The 'OK' button may now be pressed.

Make mask

With the selection made, press the Add Layer Mask button at the bottom of the Layers Palette. This will make a Layer Mask from the selection. Its possible that the mask will now require inverting. Simply 'Command i' whilst in the layer mask.

The 'Add Layer Mask' at the bottom on the Layers Pallet.

Its possible that you now have the perfect mask. However, most likely, the mask will require editing. To get a better idea of how good your mask is, 'Alt click' on the mask in the Layers Pallet. This will show the mask in the window. In this case, the face needs some editing.

'Alt click' on the mask in the layers Pallet to reveal the mask in the window.

To 'stress test' the mask, press 'Command L' to summon the Levels adjustment. Move the middle slider (the 'gamma') to either side. This reveals any flaws in the mask. This temporary adjustment is only for testing purposes. Do not press the 'OK' button. This test is known as a 'Gamma Slam'. Moving the gamma slider to the left will test the black of the mask, and to the right the white of the mask. In this case, the background looks a bit noisy... however, the background is probably good enough to require no more work.

A gamma slam showing up the noise in the mask.

Edit the mask

Having made the preliminary mask you now need to get rid of the obvious noise and imperfections. The white 'keep' area of the mask is called the holdout and the black 'remove' section is called the junk. Both might require attention.

Edit non-bordering regions

Editing regions of the mask that do not include any border is simple. Just painting them out with a brush. In the case below, the girls face does not include any border.

The imperfections in the mask of the girl's face do not include any border and can easily be painted out.

Edit hard edges

For refining a hard edge object, Clamping may be employed.

Here the edge of the boy's shoulder is showing a white fringe when placed against a black background (n.b. it might look ok against a white background).
To make the clamp work more effectively, a slight blur has been applied to the edge using the Blur Tool.
Here a Levels adjustment has been applied. By moving the sliders around, the edge can be softened, hardened and/or moved.

Edit soft edges

In the masking of a figure, the hair will require a very soft mask. The problem is that any severe adjustment to a mask is likely to damage these soft regions. Therefore, in the example case of the image of the boy, any edit to the hard-edged cloth will damage the hair.

There is a way of combining a junk and holdout adjustment in such a way as to leave the bordering edges untouched. However, it is for advanced users. Details are here: Dilate Erode Combine.

For newbies, the simplest approach is to first make a 'pre-selection' using a Lasso or Marquee. This should encompass only the hard-edged regions. By doing so, any edit made to the mask will not include its soft-edged regions.

Edit by painting

For painting into tight regions of the mask, the cutting-in method may be used:

This hand is to be masked out manually. The sharp edge folds in the cloth and the small negative shapes are very hard to paint inside of.
Here is a poorly painted mask (junk mask shown as green). Its edges are very 'rounded'. The temptation is to refine the mask using a tiny brush (laborious and inaccurate).
The solution is to employ the 'cutting in'® method. Stage one: paint-out with a black, ignoring the fact that you are overpainting.
Stage two: cut-in with white:.
Stage three: bake until cooked.

Layer Clipping and Masking

In the example below, the hair of the masked girl has a white fringe. This cannot be fixed using a clamp as it would damage the softness of the hair. Instead it is fixed after the mask process is complete. This is done by first clipping a layer to the masked layer. Then, using a Clone Tool, the hair is patched. Remember to set the 'clone sample mode' to 'Current & Below'.

Here the edge of the girl's hair is showing a white fringe when placed against a black background (n.b. it might look perfect ok against a white background).
On a clipped layer, some hair is patched onto the white fringe.

Miscellaneous Observations

The following are some miscellaneous observation reading the art and craft of masking.

Masking as drawing

Masking is a drawing activity. Organic shapes in particular can be subject to a lot of creative refinement in the process of masking. In the before (left) and after (right) below the shape of the girl has been clarified and the unfortunate wiggly pattern on the outline of her right sleeve has been removed.

Selecting 05.png

Where are you?

Whilst masking, be aware of where you are. After having made the mask from a selection you will be taken automatically to the mask component of the layer (B). Any painting or filling will be done to the mask. If you accidentally navigate to the layer contents component then you may well accidentally painting into the layer contents component of the layer (A). This is a BAD thing. Option Click on the mask to get into and out of it.

Selecting 01.png

See also

Channels

Clamp, Dilate and Erode

Taking a Photo

Quick Mask Mode