Kore Nordmann has written up some graphics manipulation functionality in PHP that can draw two different types of images automatically - those based on the Lindenmayer system and ones using bezier curves and BSplines. He describes them in this new blog post.
This implements the Lindenmayer system in PHP. This is a system to draw images based on simple grammars. Most used for fractals or to simulate natural growth of plants.
Another thing I needed to understand - and imho the easiest way is just to implement it - are bezier curves and BSplines. This class offers a simple way to draw lines, bezier curves or BSplines from an array with points.
The last days I was busy learning for a lecture for computer science which covers a lot of algorithms in graphics manipulation. For personal education I tried to implement some of them in the language I know best ... PHP.
You can see examples (and get the code) for these libraries from: