> ## Documentation Index
> Fetch the complete documentation index at: https://docs.glasswarp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Mona Lisa: precise drags in Paint

> An agent paints a ~40×60 / 18-color Mona Lisa mosaic in Paint and saves it to the Desktop.

An agent turns a portrait into a paint-by-numbers plan (\~40 columns × \~60 rows,
18 quantized colors), paints it in **MS Paint** on a real Windows PC, and saves
the JPEG to the Desktop — through the Glasswarp API. Paint is left open when the
session ends so you can see the result.

```
launch_app(mspaint)
  → draw tile grid → fill colors (UIA Edit Colors)
  → Save As: address bar → shell:Desktop → short filename → Save
  → end_session(keep_apps=True)  # Paint stays open
```

<Note>
  **Platform vs agent:** Glasswarp provides eyes and hands. The tile plan and
  Save As recipe are example / customer code. See
  [Safe agent sessions](/guides/safe-agent-sessions).
</Note>

## Run

```bash theme={null}
pip install "glasswarp[demos]"
export GLASSWARP_API_KEY=gw_live_sk_...
glasswarp-demo mona-lisa
```

Repo checkout:

```bash theme={null}
cd sdk/python
pip install "glasswarp[grounding]"
python examples/paint_mona_lisa_demo.py
```

Bundled source: `examples/assets/mona_lisa.jpg`.

## Why it's hard

Continuous drag paths break over laggy transports — if the strokes look right,
the transport is right.

* **Exact color** via Paint's Edit Colors dialog (UIA), not pixel guessing
* **Native drags / fills** on a real Win32 canvas
* **Fresh host screenshot** for verify — API capture JPEG (DXGI or GDI), not a
  re-encoded Live View / WebRTC frame

## Tuning

| Env | Default | Purpose |
| - | - | - |
| `MONA_COLS` | `40` | Mosaic columns (\~2400 tiles with aspect rows) |
| `MONA_COLORS` | `18` | Palette size (Edit Colors visits) |
| `MONA_SAVE_NAME` | `mona_glasswarp.jpg` | Desktop filename |
| `PAINT_PATH` | `mspaint.exe` | App to launch |

## Robust Save As (optional)

If Save As fails on your Paint build, the longer dialog-recovery script is:

```bash theme={null}
python examples/paint_mona_lisa_demo_robust.py
```

Prefer the default showcase (`glasswarp-demo mona-lisa`, 40×18) for docs and demos.

## Related

* [Paint wordmark](/examples/paint)
* [Agent loop](/guides/agent-loop)
* [Safe agent sessions](/guides/safe-agent-sessions)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.