bitart-generator-0.8.0 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 or animated GIF.
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)
- PNG & GIF Export — Save as 512x512 PNG or animated GIF (3 frames at 3fps)
- Mode Toggle — Switch between PNG and GIF mode with
Shift+Tab - 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
- CLI Mode — Generate art directly from command line with
-p,-o, and-gflags - 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
Interactive TUI
This opens the TUI. Type a prompt and press Enter to generate pixel art. Use Shift+Tab to toggle between PNG and GIF mode. In GIF mode, 3 frames are generated and animated in the preview.
CLI Mode
Generate art directly without the TUI:
# Generate PNG
# Generate with custom output path
# Generate animated GIF (3 frames at 3fps)
# GIF with custom path
# Show help
Keybindings (TUI)
| Key | Action |
|---|---|
Shift+Tab |
Toggle PNG/GIF mode |
Enter |
Generate art from prompt / New prompt |
Ctrl+N |
New prompt |
Ctrl+S |
Save to output.png or output.gif |
Ctrl+R |
Regenerate same prompt |
Ctrl+C |
Open config (change model/API key) |
Ctrl+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 (GIF mode animates between frames) - Export — Press
sto save as a 512x512 PNG or animated GIF
Project Structure
src/
├── main.rs # Entry point + CLI mode
├── config.rs # API key & model config (~/.bitart/config.json)
├── generator/
│ ├── mod.rs # Async generation orchestrator (single + multi-frame)
│ └── dalle.rs # DALL-E API integration
├── tui/
│ └── mod.rs # Ratatui TUI (setup, input, canvas, status)
└── exporter/
└── mod.rs # PNG & GIF export (image crate)
License
MIT