# net.weirdlings.pixel.defs

> Shared definitions for small pixel-art images stored as text grids, so a drawing lives in the record itself and any app can render it without a blob.

- Kind: defs
- Authority: pixel.weirdlings.net
- Lexicon: 1
- Published by [wim.weirdlings.net](https://lexicon.garden/identity/did:plc:zzz5fpuojop4ucigq3xpol7y), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:zzz5fpuojop4ucigq3xpol7y/net.weirdlings.pixel.defs)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:zzz5fpuojop4ucigq3xpol7y/net.weirdlings.pixel.defs/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:zzz5fpuojop4ucigq3xpol7y/net.weirdlings.pixel.defs/analytics)

## #image (`net.weirdlings.pixel.defs#image`)

Type: object

A pixel-art image: a palette and a grid of rows, top row first. In each row, '.' is a transparent pixel and the characters 1-9 then a-z pick palette colours 1 to 35, in that order (so '1' is the first colour, 'a' the tenth). Every row has exactly width characters and there are exactly height rows.

### Properties

- `height` (integer, required): Height in pixels.
  - Constraints: minimum: 1, maximum: 64
- `palette` (ref, required)
  - Reference: `#palette`
- `rows` (array, required): The grid, top row first: height rows of width characters each.
  - Constraints: minLength: 1, maxLength: 64
  - `items` (string)
    - Constraints: minLength: 1, maxLength: 64
- `width` (integer, required): Width in pixels.
  - Constraints: minimum: 1, maximum: 64

## #palette (`net.weirdlings.pixel.defs#palette`)

Type: object

The colours an image's characters index into, carried in the record so the image renders the same everywhere, even if the palette it came from changes later.

### Properties

- `colors` (array, required): Up to 35 colours as #rrggbb hex, in order: entry 1 is drawn by '1', entry 10 by 'a'.
  - Constraints: minLength: 1, maxLength: 35
  - `items` (string)
    - Constraints: minLength: 7, maxLength: 7
- `name` (string): Optional name of the palette the colours came from, like "field". Informational: always draw from colors.
  - Constraints: maxLength: 64

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "image": {
      "description": "A pixel-art image: a palette and a grid of rows, top row first. In each row, '.' is a transparent pixel and the characters 1-9 then a-z pick palette colours 1 to 35, in that order (so '1' is the first colour, 'a' the tenth). Every row has exactly width characters and there are exactly height rows.",
      "properties": {
        "height": {
          "description": "Height in pixels.",
          "maximum": 64,
          "minimum": 1,
          "type": "integer"
        },
        "palette": {
          "ref": "#palette",
          "type": "ref"
        },
        "rows": {
          "description": "The grid, top row first: height rows of width characters each.",
          "items": {
            "maxLength": 64,
            "minLength": 1,
            "type": "string"
          },
          "maxLength": 64,
          "minLength": 1,
          "type": "array"
        },
        "width": {
          "description": "Width in pixels.",
          "maximum": 64,
          "minimum": 1,
          "type": "integer"
        }
      },
      "required": [
        "width",
        "height",
        "palette",
        "rows"
      ],
      "type": "object"
    },
    "palette": {
      "description": "The colours an image's characters index into, carried in the record so the image renders the same everywhere, even if the palette it came from changes later.",
      "properties": {
        "colors": {
          "description": "Up to 35 colours as #rrggbb hex, in order: entry 1 is drawn by '1', entry 10 by 'a'.",
          "items": {
            "maxLength": 7,
            "minLength": 7,
            "type": "string"
          },
          "maxLength": 35,
          "minLength": 1,
          "type": "array"
        },
        "name": {
          "description": "Optional name of the palette the colours came from, like \"field\". Informational: always draw from colors.",
          "maxLength": 64,
          "type": "string"
        }
      },
      "required": [
        "colors"
      ],
      "type": "object"
    }
  },
  "description": "Shared definitions for small pixel-art images stored as text grids, so a drawing lives in the record itself and any app can render it without a blob.",
  "id": "net.weirdlings.pixel.defs",
  "lexicon": 1
}
```
