The cytocomputer, an image processing computer employing logical neighborhood operations similar to cellular automata transition functions has been developed. Various sequences of cytocomputer operations transform a primitive image configuration (a single dot) into various geometric shapes. A system has been developed which, when presented with an image containing some shape, produces a sequence of cytocomputer operations which generates that shape. The system uses a genetic algorithm to find the correct sequence of operations. In the genetic algorithm, strings of cytocomputer commands play the role of chromosomes, and undergo reproduction, crossover, and mutation in a process that mimics the scheme evolution uses to find increasingly fit biological organisms. The commands for generating a shape, once known, can be transformed for use in a pattern matching process which detects the presence of the shape in an image.