Chris Coyne
 

Big Picture Stuff
Programming

Context Free Design Grammar (CFDG)

The Basic Idea

CFDG is a very simple language I made for generating pictures. It's inspired by natural language and the basic idea is that every shape is described only in terms of other shapes. Nothing in a CFDG picture has any idea of its own context - size, rotation, and even color and transparency are all relative.

The tree above ("foggy tree") took only 10 lines to describe in CFDG. It's a small image, but CFDG can render it just as easily at a gigapixel with hundreds of millions of branches.

To use CFDG, you write a simple text file as an input (a .cfdg file). CFDG does the rest, spitting out an image high enough in resolution to print.

Next: A simple example