bitart-generator-0.4.1 is not a library.
BitArt Generator
A terminal-based pixel art generator built in Rust. Generate 64x64 pixel art from text prompts using DALL-E image generation. View art directly in your terminal and export to PNG.
Features
- AI Generation — Uses OpenAI DALL-E API to generate pixel art from text prompts
- Model Selection — Choose between DALL-E 2 ($0.02/image) or DALL-E 3 ($0.04/image)
- Setup Wizard — First-launch setup for model selection and API key entry
- Config Management — Change model or API key anytime with
ckeybind - Terminal Preview — Full-color pixel art rendered with Unicode block characters
- PNG Export — Save art as 512x512 PNG (8x upscaled from 64x64)
- Interactive TUI — Built with Ratatui for a smooth terminal experience
Installation
npm (Easiest)
Homebrew (macOS/Linux)
Cargo (From Source)
Requires Rust 1.70+:
From Releases
Download the latest binary from Releases.
Setup
On first launch, BitArt will prompt you to:
- Select a model — DALL-E 2 (cheapest) or DALL-E 3 (better quality)
- Enter your OpenAI API key — Get one at platform.openai.com/api-keys
Your config is saved to ~/.bitart/config.json and persists across sessions.
Usage
This opens the TUI. Type a prompt and press Enter to generate pixel art.
Keybindings
| Key | Action |
|---|---|
Enter |
Generate art from prompt / New prompt |
s |
Save to output.png |
r |
Regenerate same prompt |
c |
Open config (change model/API key) |
q |
Quit |
Esc |
Quit |
How It Works
- Enter a prompt — e.g. "neon city skyline", "sunset mountains", "pixel art cat"
- Generation — Sends prompt to DALL-E API, downloads the image, and downscales to 64x64 pixels
- Preview — Art is displayed in your terminal using colored
██Unicode blocks - Export — Press
sto save as a 512x512 PNG to./output.png
Project Structure
src/
├── main.rs # Entry point
├── config.rs # API key & model config (~/.bitart/config.json)
├── generator/
│ ├── mod.rs # Async generation orchestrator
│ └── dalle.rs # DALL-E API integration
├── tui/
│ └── mod.rs # Ratatui TUI (setup, input, canvas, status)
└── exporter/
└── mod.rs # PNG export (image crate)
License
MIT