genart.dev

.genart File

Complete specification of the .genart sketch file format

.genart File Format

A .genart file is a self-contained JSON document representing a single generative art sketch. It includes metadata, renderer configuration, parameters, colors, algorithm code, and state.

Format version

Current version: 1.3

The genart field specifies the format version. Version 1.0 files without a renderer field default to { "type": "p5" }.

Required fields

FieldTypeDescription
genartstringFormat version ("1.1")
idstringUnique sketch identifier
titlestringHuman-readable title
createdstringISO 8601 timestamp
modifiedstringISO 8601 timestamp
rendererobjectRenderer configuration
canvasobjectCanvas dimensions
parametersarrayParameter definitions
colorsarrayColor palette definitions
stateobjectCurrent runtime state
algorithmstringAlgorithm source code

Renderer

{
  "renderer": {
    "type": "p5",
    "version": "1.x"
  }
}

Supported types: p5, three, glsl, canvas2d, svg. See Renderers for details.

Canvas

Dimensions can be explicit or reference a preset:

{ "canvas": { "width": 1200, "height": 1200 } }
{ "canvas": { "preset": "hd-1920x1080" } }

See Canvas Presets for all 17 built-in presets.

Parameters

Each parameter defines a control for the algorithm:

{
  "parameters": [
    {
      "key": "amplitude",
      "label": "Wave Amplitude",
      "type": "number",
      "min": 5,
      "max": 80,
      "step": 1,
      "default": 40,
      "tab": "waves"
    }
  ]
}
FieldTypeRequiredDescription
keystringyesUnique identifier within the sketch
labelstringnoDisplay label
typestringyes"number", "boolean", "string", "select"
minnumbernoMinimum value (number type)
maxnumbernoMaximum value (number type)
stepnumbernoStep increment (number type)
defaultanyyesDefault value
tabstringnoTab group assignment

Parameter keys must be unique. The default value must be within min/max range.

Colors

Color palette definitions:

{
  "colors": [
    { "key": "background", "label": "Background", "default": "#0A0A0A" },
    { "key": "stroke", "label": "Stroke Color", "default": "#22D3EE" }
  ]
}

Themes

Optional named color presets:

{
  "themes": [
    {
      "name": "Neon",
      "colors": ["#0A0A0A", "#00FF41", "#FF00FF"]
    },
    {
      "name": "Warm",
      "colors": ["#1A0A00", "#FF6B35", "#FFD700"]
    }
  ]
}

State

Current runtime values:

{
  "state": {
    "seed": 42,
    "params": { "amplitude": 40, "frequency": 0.05 },
    "colorPalette": ["#0A0A0A", "#22D3EE"]
  }
}

Snapshots

Historical state captures:

{
  "snapshots": [
    {
      "id": "snap-001",
      "label": "Best composition",
      "timestamp": "2026-02-14T12:00:00Z",
      "state": { "seed": 99, "params": { "amplitude": 60 }, "colorPalette": ["#0A0A0A", "#FF6B35"] },
      "thumbnailDataUrl": "data:image/jpeg;base64,..."
    }
  ]
}

Optional fields

FieldTypeDescription
subtitlestringShort description
skillsstring[]Design skills used (e.g., ["golden-ratio", "complementary"])
philosophystringMarkdown text explaining the artistic intent
tabsobject[]Tab definitions for parameter grouping
themesobject[]Named color presets
snapshotsobject[]Historical state snapshots
componentsComponentRef[]Declared component dependencies
layersLayerDef[]Design layer stack (see Design Mode)
compositionLevelnumber1-4, calibrates critique severity
symbolsSketchSymbolValue[]Symbol instances used in the sketch
referencesReference[]Inspiration reference images with analysis
seriesSeriesDefSeries membership and stage
lineageLineageDefFork/promote history

Components

Declared component dependencies that the algorithm uses:

{
  "components": [
    { "name": "prng", "version": "^1.0.0" },
    { "name": "noise-2d", "version": "^1.0.0" }
  ]
}

See Components for the component tools.

Layers

Design layer stack rendered by the compositor on top of the algorithm output:

{
  "layers": [
    {
      "id": "layer-001",
      "type": "typography:text",
      "name": "Title",
      "visible": true,
      "locked": false,
      "opacity": 1,
      "blendMode": "normal",
      "properties": { "text": "Hello", "fontSize": 48, "color": "#FFFFFF" },
      "transform": { "x": 100, "y": 50, "width": 400, "height": 80 }
    }
  ]
}

See Design Mode for details on layers, plugins, and the compositor.

Symbols

Symbol instances attached to the sketch:

{
  "symbols": [
    { "id": "sym-001", "symbolId": "star", "source": "library", "fillColor": "#FFD700" }
  ]
}

See Symbols plugin for the full symbol system.

References

Inspiration reference images with optional structured analysis:

{
  "references": [
    {
      "id": "ref-001",
      "type": "artwork",
      "source": "Monet, Water Lilies",
      "imagePath": "references/monet.jpg",
      "analysis": {
        "composition": "Horizontal bands of water and sky",
        "palette": ["#2D5016", "#7BA3C9", "#E8D4B8"],
        "mood": "Serene, contemplative"
      }
    }
  ]
}

See Reference tools for importing and analyzing references.

Series

Series membership with narrative context:

{
  "series": {
    "id": "series-001",
    "label": "Organic Growth",
    "stage": "refinements"
  }
}

Lineage

Fork and promotion history:

{
  "lineage": {
    "forkedFrom": "parent-sketch-id",
    "forkedAt": "2026-03-01T12:00:00Z",
    "generation": 2,
    "promotedFrom": "study-sketch-id",
    "promotedAt": "2026-03-02T10:00:00Z"
  }
}

## Minimal example

```json
{
  "genart": "1.3",
  "id": "minimal-example",
  "title": "Minimal Example",
  "created": "2026-02-14T00:00:00Z",
  "modified": "2026-02-14T00:00:00Z",
  "renderer": { "type": "p5", "version": "1.x" },
  "canvas": { "width": 1200, "height": 1200 },
  "parameters": [],
  "colors": [],
  "state": { "seed": 42, "params": {}, "colorPalette": [] },
  "algorithm": "function sketch(p, state) {\n  p.setup = () => {\n    p.createCanvas(state.canvas.width, state.canvas.height);\n    p.background(20);\n  };\n  p.draw = () => {};\n  return { initializeSystem() {} };\n}"
}

Validation rules

The parser rejects files that:

  • Are missing any required field (id, algorithm, etc.)
  • Have an unknown renderer.type
  • Have an unrecognized canvas.preset
  • Have duplicate parameter keys
  • Have a default value outside the min/max range