login signup

Graffiti Markup Language (GML)

Graffiti Markup Language (.gml) is an open XML format for recording how a drawing was made: the points of each stroke, their order and their timestamps. Blackbook is an archive of these recordings, not just pictures of finished tags.

A drawing in motion

A final image shows the result. GML also preserves the movement: where a stroke starts, how fast it travels, when the writer pauses and when the next stroke begins. A player can replay or scrub that motion, or render the same drawing with a different brush. GML does not store a photograph of the ink or wall.

Writers meet hackers

Two hands shaking, one holding a marker and one a keyboard

Writers capture and share their gestures; programmers turn the same data into players, visualizations and new tools. Projects including Graffiti Analysis and EyeWriter use GML to connect different ways of drawing.

Try it

Interactive playback and recording need JavaScript. The explanation and XML below remain readable without it.

Inside a .gml file

This small example draws right for one second, then down for one second. Each stroke groups points made without lifting the pen. A pt contains x and y coordinates and a time in seconds. Here, coordinates use a normalized 0–1 canvas; the environment records its size and orientation.

<gml spec="1.0">
  <tag>
    <header>
      <client><name>GML example</name></client>
      <environment>
        <screenBounds><x>1</x><y>1</y><z>0</z></screenBounds>
        <up><x>0</x><y>1</y><z>0</z></up>
      </environment>
    </header>
    <drawing>
      <stroke>
        <pt><x>0.1</x><y>0.2</y><time>0</time></pt>
        <pt><x>0.8</x><y>0.2</y><time>1</time></pt>
        <pt><x>0.8</x><y>0.8</y><time>2</time></pt>
      </stroke>
    </drawing>
  </tag>
</gml>

Specifications and tools

The Blackbook API

GML is the file format. The Blackbook API is the separate service for sharing those files. Read the API documentation to download or upload drawings. The OpenAPI specification describes the HTTP endpoints.

Play the example

The XML above makes a single corner: right for one second, then down for one second. Use the playback controls to pause or scrub through its two seconds of motion.

Three points, one stroke 1 stroke // 3 pts // 2s

Edit this page on GitHub