# com.lvl99.paintcanvas.document

> A PaintCanvas drawing, keyed by its ID (a UUID). Its layers and thumbnail are PNG images.

- Kind: record
- Record key: any
- Authority: paintcanvas.lvl99.com
- Lexicon: 1
- Published by [livecanvas.lvl99.com](https://lexicon.garden/identity/did:plc:pnraiwv3cf2ue5qdfsrze63z), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:pnraiwv3cf2ue5qdfsrze63z/com.lvl99.paintcanvas.document)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:pnraiwv3cf2ue5qdfsrze63z/com.lvl99.paintcanvas.document/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:pnraiwv3cf2ue5qdfsrze63z/com.lvl99.paintcanvas.document/analytics)

## Record (`com.lvl99.paintcanvas.document`)

Type: record · key any

### Properties

- `activeLayer` (string): `layerId` of the layer being drawn on.
  - Constraints: maxLength: 100
- `author` (array, required): Everyone who drew in it, e.g. everyone in the drawing session it was made in.
  - Constraints: minLength: 1, maxLength: 100
  - `items` (ref)
    - Reference: `com.lvl99.paintcanvas.defs#author`
- `createdAt` (string · datetime, required): When the drawing was made.
- `external` (array): Images drawn by others, shown over the layers.
  - Constraints: maxLength: 100
  - `items` (ref)
    - Reference: `#externalImage`
- `height` (integer, required): Height in pixels.
  - Constraints: minimum: 1, maximum: 10000
- `layers` (array, required): The layers, from bottom to top.
  - Constraints: minLength: 1, maxLength: 100
  - `items` (ref)
    - Reference: `#layer`
- `name` (string, required): The drawing's name.
  - Constraints: maxLength: 1000, maxGraphemes: 100
- `openedAt` (string · datetime): When the drawing was last opened.
- `thumbnail` (ref)
  - Reference: `#thumbnail`
- `updatedAt` (string · datetime): When it was last changed (opening it doesn't count), to sync copies kept in more than one place.
- `width` (integer, required): Width in pixels.
  - Constraints: minimum: 1, maximum: 10000

## #externalImage (`com.lvl99.paintcanvas.document#externalImage`)

Type: object

### Properties

- `image` (blob, required)
  - Constraints: maxSize: 50000000, accept: image/png
- `source` (string, required): Who or what drew it, e.g. a DID.
  - Constraints: maxLength: 2048

## #layer (`com.lvl99.paintcanvas.document#layer`)

Type: object

### Properties

- `alphaLock` (boolean): Whether drawing only changes pixels that aren't transparent.
- `blendingMode` (string): How it's blended with the layers below (canvas composite operations). "source-over" if not set.
  - Constraints: maxLength: 32, knownValues: source-over | screen | lighten | multiply | darken | overlay
- `image` (blob, required): The layer's pixels.
  - Constraints: maxSize: 50000000, accept: image/png
- `layerId` (string, required): The layer's ID, unique in the drawing.
  - Constraints: maxLength: 100
- `name` (string, required): The layer's name.
  - Constraints: maxLength: 640, maxGraphemes: 64
- `opacity` (integer): Opacity in thousandths, from 0 (transparent) to 1000 (opaque). Opaque if not set.
  - Constraints: minimum: 0, maximum: 1000
- `visible` (boolean): Whether it's shown. Shown if not set.

## #thumbnail (`com.lvl99.paintcanvas.document#thumbnail`)

Type: object

### Properties

- `height` (integer, required)
  - Constraints: minimum: 1, maximum: 200
- `image` (blob, required)
  - Constraints: maxSize: 1000000, accept: image/png
- `width` (integer, required)
  - Constraints: minimum: 1, maximum: 200

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "externalImage": {
      "properties": {
        "image": {
          "accept": [
            "image/png"
          ],
          "maxSize": 50000000,
          "type": "blob"
        },
        "source": {
          "description": "Who or what drew it, e.g. a DID.",
          "maxLength": 2048,
          "type": "string"
        }
      },
      "required": [
        "source",
        "image"
      ],
      "type": "object"
    },
    "layer": {
      "properties": {
        "alphaLock": {
          "description": "Whether drawing only changes pixels that aren't transparent.",
          "type": "boolean"
        },
        "blendingMode": {
          "description": "How it's blended with the layers below (canvas composite operations). \"source-over\" if not set.",
          "knownValues": [
            "source-over",
            "screen",
            "lighten",
            "multiply",
            "darken",
            "overlay"
          ],
          "maxLength": 32,
          "type": "string"
        },
        "image": {
          "accept": [
            "image/png"
          ],
          "description": "The layer's pixels.",
          "maxSize": 50000000,
          "type": "blob"
        },
        "layerId": {
          "description": "The layer's ID, unique in the drawing.",
          "maxLength": 100,
          "type": "string"
        },
        "name": {
          "description": "The layer's name.",
          "maxGraphemes": 64,
          "maxLength": 640,
          "type": "string"
        },
        "opacity": {
          "description": "Opacity in thousandths, from 0 (transparent) to 1000 (opaque). Opaque if not set.",
          "maximum": 1000,
          "minimum": 0,
          "type": "integer"
        },
        "visible": {
          "description": "Whether it's shown. Shown if not set.",
          "type": "boolean"
        }
      },
      "required": [
        "layerId",
        "name",
        "image"
      ],
      "type": "object"
    },
    "main": {
      "description": "A PaintCanvas drawing, keyed by its ID (a UUID). Its layers and thumbnail are PNG images.",
      "key": "any",
      "record": {
        "properties": {
          "activeLayer": {
            "description": "`layerId` of the layer being drawn on.",
            "maxLength": 100,
            "type": "string"
          },
          "author": {
            "description": "Everyone who drew in it, e.g. everyone in the drawing session it was made in.",
            "items": {
              "ref": "com.lvl99.paintcanvas.defs#author",
              "type": "ref"
            },
            "maxLength": 100,
            "minLength": 1,
            "type": "array"
          },
          "createdAt": {
            "description": "When the drawing was made.",
            "format": "datetime",
            "type": "string"
          },
          "external": {
            "description": "Images drawn by others, shown over the layers.",
            "items": {
              "ref": "#externalImage",
              "type": "ref"
            },
            "maxLength": 100,
            "type": "array"
          },
          "height": {
            "description": "Height in pixels.",
            "maximum": 10000,
            "minimum": 1,
            "type": "integer"
          },
          "layers": {
            "description": "The layers, from bottom to top.",
            "items": {
              "ref": "#layer",
              "type": "ref"
            },
            "maxLength": 100,
            "minLength": 1,
            "type": "array"
          },
          "name": {
            "description": "The drawing's name.",
            "maxGraphemes": 100,
            "maxLength": 1000,
            "type": "string"
          },
          "openedAt": {
            "description": "When the drawing was last opened.",
            "format": "datetime",
            "type": "string"
          },
          "thumbnail": {
            "ref": "#thumbnail",
            "type": "ref"
          },
          "updatedAt": {
            "description": "When it was last changed (opening it doesn't count), to sync copies kept in more than one place.",
            "format": "datetime",
            "type": "string"
          },
          "width": {
            "description": "Width in pixels.",
            "maximum": 10000,
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "name",
          "author",
          "createdAt",
          "width",
          "height",
          "layers"
        ],
        "type": "object"
      },
      "type": "record"
    },
    "thumbnail": {
      "properties": {
        "height": {
          "maximum": 200,
          "minimum": 1,
          "type": "integer"
        },
        "image": {
          "accept": [
            "image/png"
          ],
          "maxSize": 1000000,
          "type": "blob"
        },
        "width": {
          "maximum": 200,
          "minimum": 1,
          "type": "integer"
        }
      },
      "required": [
        "width",
        "height",
        "image"
      ],
      "type": "object"
    }
  },
  "description": "A PaintCanvas drawing, keyed by its ID (a UUID). Its layers and thumbnail are PNG images.",
  "id": "com.lvl99.paintcanvas.document",
  "lexicon": 1
}
```
