Description
The Feature Selector node allows you to generate a grayscale mask from a selection of pixel regions of similar color (referred to as ‘features’) in the input texture.
The node automatically identifies a set of such features in the input texture. There is no way to manually define a feature, but you can fine-tune the automatic feature definition behavior by adjusting the node properties - specifically Granularity, Color, Regularity, and Smoothness. See more on properties and their effects in the Properties section below.
You can create a selection from one or more features by bringing the node into the 2D Viewport and using the node’s 2D Viewport Overlay.
When you execute the node, it creates a black and white mask. All pixels within the features you selected are colored white, and the rest are colored black.
Selecting features in the 2D Viewport
Here are the steps to creating and adjusting a selection:
- Bring the Feature Selector node into the 2D Viewport.
- The 2D Viewport displays an overlay, where the input texture is segmented into regions separated by black borders. Each region represents a single selectable feature. You can change the overlay color and opacity in the node properties.
- To select a feature, left click (LMB) on its region in the viewport. The region fills with the Overlay Color (teal by default), which indicates that it is currently selected.
- Add more features to the selection by holding SHIFT and clicking on additional regions.
- Remove features from the selection by holding CTRL and clicking one of the selected regions.
- Invert the selection by clicking the Invert button in the node properties.
A number of shortcut keys are used when selecting features in the viewport. See the full list of shortcuts at the end of this section.
Using Lasso Selection
An alternative way to select features is by using the Lasso Selection tool. This allows you to draw a polygonal lasso by placing multiple points in the 2D Viewport. When you close the lasso, the node creates a new selection from the features that are inside the lasso area.
Here are the steps to using Lasso Selection:
- With the Feature Selector node in the 2D Viewport, press the L key.
- A lasso icon appears in place of your mouse cursor. This indicates that Lasso Selection is active. You can press the L key again to deactivate the tool.
- To start a lasso selection, left click the point in the 2D Viewport where you want the lasso to begin.
- Add more points to the lasso by left clicking elsewhere in the viewport.
- Close the lasso by clicking the first point you placed.
- The node creates a selection from features inside the lasso area.
2D Viewport Controls
Below is a complete list of shortcuts for working with the 2D Viewport Overlay.
Action | Description |
---|---|
LMB | Select a single feature by clicking on its region in the viewport. |
Hold LMB and drag | Select one or more features by dragging over their regions in the viewport. |
CTRL + LMB | Deselect a single feature. |
CTRL + hold LMB and drag | Deselect one or more features. |
SHIFT + LMB | Add a single feature to the current selection. |
SHIFT + hold LMB and drag | Add one or more features to the current selection. |
L | Press to activate the Lasso Selection tool. |
Generating a mask from a selection
Once you have a selection ready, you can create a new mask from it by executing the node.
Feature Selector outputs the mask as a texture, which you can use elsewhere in the Node Graph of your project.
Category and execution
Node category | Paint |
---|---|
Node execution style | Manual |
Ports
Input Type | Description |
---|---|
Bitmap | The input texture from which you want to select features. |
Output Type | Description |
---|---|
Bitmap (Mask) | The output mask texture which contains a representation of the selection. |
Properties
Property/Setting | Description |
---|---|
Granularity | Control the size and number of features which the input texture is broken into. Higher values produce more, smaller features. |
Color | Control how strongly color similarity influences the formation of feature regions. At higher values, the node is more selective in judging colors as similar. As a result, the feature borders follow different colors more precisely. |
Regularity | Control how blocky the features are. At higher values, features maintain a primarily square shape and are more similar to each other in size. |
Smoothness | Control the smoothness of feature region borders. At higher values, the node avoids adding many small pixels along feature borders, effectively smoothing them out. |
Overlay Color | Set the color of the selection overlay in the 2D Viewport. |
Overlay Opacity | Set the opacity of the selection overlay in the 2D Viewport. |