Repository avatar
Other Tools
v0.2.0
active

levni

dev.levni/levni

Illustrations, brand assets and brand boards from JSON scenes. 1,600+ drawings, free and local.

Documentation

Levni

Levni: a garden in miniature colours, drawn by Levni

An open illustration library and the engine that draws it. Levni turns a short JSON scene into a hand-inked, riso-printed image: covers, spot illustrations, icons, charts and social images in one consistent house style. No image model, no account, no API key, no cost per image. It runs on your machine, and your AI assistant can drive it through MCP.

Levni MCP server npm

levni.dev · Features · Library · MCP guide · Powered by Ortak Alan

Named after Levni, the 18th-century Ottoman painter of the Tulip Era, whose colours still look alive.

coverspotlittle 3D world
A rocket in front of a sun on a blue panel, an audience belowBooks, a coffee cup and a light bulb on a mustard discIsometric room with a desk, laptop, lamp and stool
cover.jsonspot.jsonroom.json

Quick start

With an AI assistant (MCP). Claude Code:

claude mcp add levni -- npx -y @levni/levni mcp

Claude Desktop, Cursor and other clients (claude_desktop_config.json, .cursor/mcp.json, …):

{ "mcpServers": { "levni": { "command": "npx", "args": ["-y", "@levni/levni", "mcp"] } } }

Then ask: "Illustrate this article with Levni and fix what the critic reports."

From the terminal.

npm install @levni/levni
npx @levni/levni render scene.json out.png        # or .webp / .svg; --format og|square|story|youtube; --preview
npx @levni/levni list coffee                      # search the library
npx @levni/levni sheet props.png rocket phone     # contact sheet of props, every variant

From code.

import { compose, critique, render } from '@levni/levni';

const scene = { seed: 4, elements: [{ type: 'prop', name: 'rocket', x: 600, y: 336, size: 360, shadow: true }] };
const { notes } = await render(scene, 'rocket.png');   // writes the file, returns the critic's notes
const { svg, used } = await compose(scene);            // or just the SVG

Node 20+. Two dependencies: sharp (SVG to PNG and WebP) and fontkit (reads the bundled OFL fonts for posters and display type).

What it draws

The Levni Folio1,628 drawings, 3,409 variants (481 of them pixel icons), on 15 shelves, searchable in English and Turkish. CC BY 4.0. Browse
Scenes and the critic73 element types on a 1200 × 673 canvas. Pressure-brush ink, riso plate misregistration, paper grain. Same seed, same picture. Every render returns layout notes: off-canvas, accidental crops, lopsided weight, no focal point.
Style packs and your inksriso (default), miniature (Tulip Era colours, with its own tulips, carnations, cypresses and medallion), or your own colour map: every drawing follows your brand.
Soft 3D finish"finish": "soft": clean edges and film grain. A real little 3D renderer (pure JS, no GPU): glossy ribbon3d bands (loop, Möbius, spiral, knot), torus3d, sphere3d, capsule3d, blob3d, cubes3d, interlocking shapes in one soft3d scene, extrude3d that turns any Folio drawing into a 3D icon, and soft3d cover presets ("preset": "auto", five palettes) with room for a title and an image badge. Guide
Little 3D worldsiso dioramas: one line ("preset": "cafe", also room, desk, street, city, office, classroom) lays out a seeded world on a floating slab with soil layers and a soft shadow. 37 object kinds (walls with windows, doors and arches, stairs, roofs, fences, ponds, roads, trees, lamps, furniture, cars, people, posters hung on walls), soft occlusion, painter's order from real 3D boxes, in the riso hand or "style": "soft" toy 3D.
Faceless peopleperson in 15 poses (walking, pointing, reading, phone, cheering, …), people in a row. Round heads, no faces, by design.
Fusion slotsPut any drawing inside another: a chart on a TV screen, a tulip in a magnifier's lens. 64 hosts have slots.
Hand-inked databars, linechart, pie, donut, isochart from plain numbers.
Every format, plus a titlecover, og, square, story, youtube: recomposed, not cropped. Optional headline, kicker and brand layer.
Brand assetsdither fields (Bayer squares, dots, lines, several inks) and a screen print pass that turns any scene into a 1-bit, riso, blueprint, Game Boy or newsprint image; grainy meshgrad colour fields and orbs; glyphfill (ASCII, block and dot-matrix silhouettes, a shaded globe); seal, ringtext, stub tickets and die-cut stickers; wireframe terrain, ridgelines and engrave etchings. Recipes at the end of docs/scene.md
Branding posterslevni poster: one brand spec ({ "brand": { name, tagline, mark, inks, words } }) becomes eight portrait posters (split, map, bauhaus, echo, camo, vertical, summit, launch) and a series sheet. Big type comes from the type element, which draws text as paths from bundled open fonts (Space Grotesk, Archivo Black, JetBrains Mono, Departure Mono), so it looks the same everywhere. Also block, amtone, camo, grain, shapegrid, echo, dotmatrix and furniture. Guide
Brand boardslevni board: mark, wordmark, palette, web page, social card, tote, sticker, pattern and business card in one image, from four fields ({ "brand": { name, tagline, mark, inks } }). Guide
Calm images for hard newsA blue-only pack for loss, disaster, illness, courts and grief. Guide

The miniature pack, the soft finish and soft 3D, iso dioramas, people, slots and charts:

The isometric room in miniature coloursA blue-teal gradient ribbon arching across a pale backgroundThree mint tube rings on deep purple
A floating island city in riso colours: towers, gabled houses, roads and a parkAn isometric cafe diorama with a counter, a barista and guests at round tablesA pastel street diorama in the soft style: houses, a road, lamp posts and trees
Pictogram people walking, cheering and handing over an objectA chart drawn inside an old TV screenHand-drawn bar, line and donut charts with sample data
A soft 3D cover: a glossy teal-to-indigo ribbon loop on pale blue, a title and a badgeA chain of four interlocking glossy mint and violet rings on deep purpleFive library drawings as 3D icons: rocket, light bulb, tulip, trophy, heart

Brand assets: dither, screen, mesh gradients, glyph fills, seals, terrain, etching and a whole brand board:

A dithered sunset: blue-to-coral pixel sky, a mustard sun, line-dithered waterGrainy mesh-gradient hero with a mono titleA globe drawn in ASCII characters with a lit side and a shadow side
A sticker sheet: seals with ring text, a ticket and die-cut stickersWireframe terrain at dusk with glowing streams and a rocket on the horizonEtched mountains and a sun in blue lines on paper

Branding posters: one spec, eight posters in one series (split, map, bauhaus, echo, camo, vertical, summit, launch):

A series of eight branding posters for a coffee roaster, sharing inks, type and a dove mark

A brand board for a ferry company made with one brand call: mark, wordmark, web page, palette, social card, tote, sticker, pattern, business card

Full element reference: docs/scene.md · JSON Schema: docs/scene.schema.json · all example scenes: examples/

Use it from an agent (MCP)

levni mcp runs an MCP server over stdio, on your machine. Tools:

toolwhat it does
scene_guidethe scene format (docs/scene.md); read it once
list_propssearch the Folio by word, tag or shelf
show_propsa contact image of chosen props, every variant numbered
render_scenedraw a scene: critic notes, a 560 px preview, and with out the full file (.png/.webp/.svg)
critique_sceneonly the critic's notes, for quick iterations
render_boarda brand board from { brand: { name, tagline, mark, inks } } or your own tiles; guide: true returns docs/board.md
render_postereight branding posters and a series sheet from { brand: { name, tagline, mark, inks, words } }; scenes: true returns the scenes to edit, guide: true returns docs/poster.md

From a checkout, use "command": "node", "args": ["/path/to/levni/bin/levni.mjs", "mcp"]. Files from render_scene are written relative to the client's working directory. Agents without MCP can use the CLI the same way.

Ghost: images for your drafts

Add your Ghost Admin credentials to the server's env and three more tools appear:

{ "mcpServers": { "levni": { "command": "npx", "args": ["-y", "@levni/levni", "mcp"],
  "env": { "GHOST_ADMIN_API_URL": "https://your-site.com", "GHOST_ADMIN_API_KEY": "<id>:<secret>" } } } }
toolwhat it does
ghost_draftsread-only: drafts without images, their h2 headings, and one draft's full text
ghost_previewdry run: renders the cover and inline images, shows where each goes, returns a token
ghost_applywrites, only with the token from a preview of the same plan on the unchanged draft

The assistant shows you the preview and applies after you say yes. Drafts only: nothing is published or emailed, a draft that already has images is skipped, at most one image per section. The key stays in your MCP config; Levni has no server of its own. Without the two variables the Ghost tools do not exist. The same flow from the terminal: levni ghost drafts and levni ghost attach plan.json [--apply]. Details: docs/ghost.md.

CLI

commandwhat it does
levni render <scene.json> <out>draw a scene (--format, --preview) and print the critic's notes
levni list [query]search props
levni sheet <out.png> [prop …]contact sheet, every variant on paper and on blue (--recolor)
levni board <spec.json> <out.png>brand board: {"brand": {name, tagline, mark, inks}} makes a nine-tile board in one call; or place tiles yourself, with browser/card/tote/phone mockups (docs)
levni poster <spec.json> <out-dir>branding posters: {"brand": {name, tagline, mark, inks, words}} makes eight 1200 × 1600 posters and series.png (docs)
levni add <file> [--sheet out.png]import props a chat model wrote: check, write, draw (prompt)
levni check [prop …]measure props for agents that cannot see images
levni mcpthe MCP server
levni ghost drafts / attachthe Ghost adapter (docs)
levni judge score / pickoptional: rate renders with your own OpenRouter key (docs)

Optional extras: the icon and ascii elements use Tabler Icons when installed (npm install @tabler/icons, or LEVNI_ICONS=/path). Your own prop folders: LEVNI_PROPS=/path/to/props (several, separated by :).

Keys and privacy

Drawing needs nothing: no account, no key. Two optional integrations bring your own key, kept in your environment or MCP config: Ghost (GHOST_ADMIN_API_URL, GHOST_ADMIN_API_KEY) and the judge (OPENROUTER_API_KEY). Levni sends your scenes and keys nowhere else.

Submit to the Folio

The library grows by contribution: one JSON file per drawing in library/props/, SVG paths in a 0–100 box with colour names, so every style pack can recolour it.

{
  "name": "watering-can",
  "category": "home",
  "tags": ["garden", "water", "sulama"],
  "author": "Your Name",
  "variants": [
    { "note": "side view, spout to the right", "paths": [
      { "d": "M20 40 L70 40 L66 86 L24 86 Z", "fill": "tone", "stroke": "ink", "weight": 9 },
      { "d": "M70 52 L92 30", "stroke": "ink", "weight": 9 }
    ] }
  ]
}

Rules: your own drawing (inspired by a style is fine, tracing a work is not), no faces, no hands, no logos, one object per file, readable at 120 px. Check with npx @levni/levni add my-props.json --sheet check.png, then open a pull request. Full guide: CONTRIBUTING.md. Writing many at once with a chat model: docs/prop-prompt.md.

Licensing

  • Code (src/, bin/, adapters/, test/): MIT.
  • Levni Folio (library/): CC BY 4.0. Use it anywhere, commercially too; credit "drawings by Ortak Alan (CC BY 4.0)". Origins and flagged drawings: library/NOTICE.md.
  • Tabler Icons (MIT, Paweł Kuna): an optional peer dependency, not shipped. Props redrawn from Tabler shapes say so in their files.
  • Images you render are yours; the CC BY credit applies when they contain library drawings.

Repository

folderwhat
src/the engine: compose, ink, pen, iso, assets, ribbons, people, charts, slots, formats, title, critic, styles, MCP
bin/levni.mjsthe CLI
adapters/ghost/the Ghost adapter
library/the Levni Folio and its licence
docs/scene reference and schema, Ghost, judge, sensitive stories, the chat-model prompt
examples/scenes and their renders
site/levni.dev (Astro, static, Cloudflare Pages; images drawn by Levni: npm run assets, npm run library)
test/npm test runs every test file: props, MCP, Ghost (mocked), formats, judge, critic (~2 min: it draws every variant)

Levni is made and used by Ortak Alan.

NPM
@levni/levni
Install Command
npm install @levni/levni