OOF2: The Manual

Name

OOF.Graphics_n.Toolbox.Pixel_Select.Color — Select pixels whose color is close to that of a reference pixel.

Synopsis

OOF.Graphics_n.Toolbox.Pixel_Select.Color(source,range,points,shift,ctrl)

Details

  • Parent Menu: OOF.Graphics_n.Toolbox.Pixel_Select
  • Callback: function PixelSelectToolbox.selectCB in module ooflib.common.IO.genericselecttoolbox
  • Parameters:

    source
    Microstructure or Image Type: The path to an OOF2 object.
    range
    Acceptable deviation from the reference color. Type: An object of the ColorDifference class.
    points
    Type: A list of Point objects.
    shift
    True for addition. Type: Boolean, 0 (false) or 1 (true).
    ctrl
    True for toggle. Type: Boolean, 0 (false) or 1 (true).

Description

Select pixels that are similar in color to the pixel at a given location (the reference pixel). When using the GUI, this location is given by a mouse click. In text mode the location is the first entry in the points list. Pixels selected in this way are not necessarily contiguous.

The source parameter must be the path to an Image. The selection is made in the Microstructure in which the Image resides.

Pixels will be selected if their color lies within a box of size 2 × range in the three dimensional space defined by the three components of the color. The different types of ColorDifference define the box in different ways.

The shift and ctrl parameters govern how the current selection (i.e, the set of objects defined by this operation) is merged with the previous selection (the objects already selected) to form a new selection, as shown in Table 6.1. They indicate whether (1) or not (0) the shift and control keys were depressed during the mouse click that initiated this command.

Figure 6.14. Selecting Pixels by Color

Selecting Pixels by Color

Pixels selected with the Color selector, with range=DeltaRGB(delta_red=0.1, delta_green=0.1, delta_blue=0.1).