Abstract : In this work, we call "discrete texture" any repetitive pattern composed of small, perceivable elements. A lot of art techniques involve manual production of discrete textures, that is very expensive. We address the problem of discrete texture synthesis. Previous works introduced by-example tools: simple interfaces that allow one to draw a small texture exemplar. The tool analyses this exemplar and reproduces it on a larger scale. However, these algorithms fail to reproduce faithfully both large scale effects and local structures of elements. In contrast, our approach allows one to write the program that synthesizes the texture. We provide a set of operators that distribute points, curves or regions in the plane. We show that a large range of textures can be easily designed with our system. Additionaly, we prove that many variants of classic element distribution algorithms can be written as simple combinations of our operators.