OOF2: The Manual

Name

OOF.Image.AutoGroup — Create a pixel group for each color in the image.

Synopsis

OOF.Image.AutoGroup(image)

Details

  • Parent Menu: OOF.Image
  • Callback: function createPixelGroups in module oof2.image.IO.imagemenu
  • Threadability: Threadable
  • Parameters:

    image
    Type: The path to an existing Image object.

Description

If a Microstructure is being built from an Image which has a one-to-one correspondence between pixel color and Material, then the most convenient way to assign Materials to pixels is to automatically create a PixelGroup for each color, and then to assign Materials to the pixels in each pixel group. The AutoGroup command performs the first part of this process, creating pixel groups for each color of pixel in the given Image.

[Caution] Caution

AutoGroup names each group according to the color of the pixel defining the group. This often leads to unwieldy names, such as RGBColor(red=0.97254901960784312,green=0.9882352941176471,blue=0.0). It may be advisable to rename the groups.

[Caution] Caution

Images produced by drawing programs that use antialiasing to smooth lines are generally not suitable candidates for AutoGroup. Even if an antialiased image appears to contain only a few colors, it will generally have many slightly different colors at the borders between regions, and AutoGrouping will create a large number of groups. On antialiased images it's best to select pixels with, for example, OOF.PixelSelection.Color_Range and assign them to a group manually with OOF.PixelGroup.AddSelection.


/* OOF home */ /* OOF2 home */ /* Send mail to the OOF Team */