Repotomata.RuleType
An automata rule

The rule is applied to all the image pixel for each epoch.

Fields

  • neighbours: the pixels (relative positions) observered when applying the contidtion.
  • condition: this function is called for each pixel and must return the new color.
  • extent: the image padding needed by the neighbours.
source
Repotomata.RuleMethod
Rule(neighbours, condition)

The rule constructor. It will automatically create the extent.

source
Repotomata.getcolorMethod
getcolor(rule, image, position)

Computes the colors of the neighbours around position. Calls the rule's condition function and return its result.

source
Repotomata.chromatic_ruleMethod
chromatic_rule(palette, background_color)

Create a "Chromatic rule" with the following condition:

    if current == background_color
        3 OR 4 neighbours ≠ background_color  > neighbours' color of the "smaller" in the palette
        else  > background_color
    else
        7 OR 8 neighbours ≠ background_color  > background_color
        3 OR 4 neighbours ≠ background_color  > current
        1 OR 2 neighbours ≠ background_color  > previous color in palette or reset to the middle
        5 OR 6 neighbours ≠ background_color  > next color in palette or reset to the middle
source
Repotomata.game_of_lifeMethod
game_of_life(color, background_color)

Create a "Game of life rule" with the following condition:

      if current = background_color && 3 neighbours ≠ background_color > color
      if current ≠ background_color && 2 OR 3 neighbours ≠ background_color > color
      else > background_color
source