The ImaGen package provides comprehensive support for creating resolution-independent one and two-dimensional spatial pattern distributions. ImaGen consists of a large library of primarily two-dimensional patterns, including mathematical functions, geometric primitives, images read from files, and many ways to combine or select from any other patterns. These patterns can be used in any Python program that needs configurable patterns or a series of patterns, with only a small amount of user-level code to specify or use each pattern.
Running the following code in an
ipython -pylab session generates two Gaussian patterns:
>>> import imagen >>> pg=imagen.Gaussian(xdensity=60,ydensity=60,size=0.3,aspect_ratio=1.0) >>> >>> imshow(pg(),cmap=cm.gray,interpolation='nearest') >>> imshow(pg(size=0.5),cmap=cm.gray,interpolation='nearest')
Official releases of ImaGen are available at PyPi, and can be installed along with dependencies via
pip install --user imagen or
easy_install imagen. More recent changes can be obtained by cloning the git repository.
Alternatively, after separately installing the dependencies, ImaGen can be installed via
python setup.py install (Windows users can download and run an exe from the preceding link).
ImaGen is maintained at github, but some of the documentation has not yet been moved from topographica.org:
User Manual and sample output
Reference Manual generated from the source code
Questions and comments are welcome at https://github.com/ioam/imagen/issues.