| Crates.io | dotmax |
| lib.rs | dotmax |
| version | 0.1.7 |
| created_at | 2025-12-01 18:27:27.68741+00 |
| updated_at | 2025-12-07 01:22:32.720215+00 |
| description | High-performance terminal braille rendering for images, animations, and graphics |
| homepage | https://github.com/newjordan/dotmax |
| repository | https://github.com/newjordan/dotmax |
| max_upload_size | |
| id | 1960317 |
| size | 30,728,282 |
Render anything in terminal braille. Images, GIFs, videos, webcam - one line of code.
cargo add dotmax --features image
use dotmax::quick;
quick::show_file("photo.png")?; // Any image
quick::show_file("cat.gif")?; // Animated GIF (plays automatically)
quick::show_file("movie.mp4")?; // Video (requires 'video' feature)
quick::show_webcam()?; // Live webcam (requires 'video' feature)
| Feature | What it enables | Install |
|---|---|---|
image |
PNG, JPG, GIF, APNG, BMP, WebP, TIFF | cargo add dotmax --features image |
svg |
SVG vector graphics | cargo add dotmax --features svg |
video |
Video + webcam (needs FFmpeg) | cargo add dotmax --features video |
# Cargo.toml - pick what you need
[dependencies]
dotmax = { version = "0.1", features = ["image"] } # Images only
dotmax = { version = "0.1", features = ["image", "svg"] } # Images + SVG
dotmax = { version = "0.1", features = ["video"] } # Video + webcam
Video feature requires FFmpeg installed on your system.
use dotmax::quick;
// Display (blocks until keypress or video ends)
quick::show_file("any.png")?; // Auto-detect format
quick::show_image("photo.jpg")?; // Static image only
quick::show_webcam()?; // Default webcam
quick::show_webcam_device(0)?; // Webcam by index
quick::show_webcam_device("/dev/video1")?; // Webcam by path
// Load without displaying
let grid = quick::load_image("photo.png")?; // Returns BrailleGrid
quick::show(&grid)?; // Display manually
// Create empty grid
let mut grid = quick::grid()?; // Terminal-sized
use dotmax::prelude::*;
let mut grid = grid()?;
draw_line(&mut grid, 0, 0, 100, 50)?;
draw_circle(&mut grid, 50, 25, 20)?;
draw_rectangle(&mut grid, 10, 10, 80, 40)?;
show(&grid)?;
use dotmax::animation::AnimationLoop;
AnimationLoop::new(80, 24)
.fps(30)
.on_frame(|frame, grid| {
grid.clear();
grid.set_dot((frame * 2) % 160, 48)?;
Ok(true) // Return false to stop
})
.run()?;
# Basic (no features needed)
cargo run --example hello_braille
cargo run --example bouncing_ball
cargo run --example shapes_demo
# Images
cargo run --example load_image --features image
cargo run --example dither_comparison --features image
# Animated GIF/APNG
cargo run --example animated_gif --features image -- your.gif
cargo run --example animated_apng --features image -- your.apng
# Video (needs FFmpeg)
cargo run --example video_player --features video -- your.mp4
# Webcam (needs FFmpeg + camera)
cargo run --example webcam_viewer --features video
cargo run --example webcam_tuner --features video # Interactive settings
Tuners let you find the best render settings visually. Adjust dithering, brightness, contrast, etc. in real-time and see the results instantly.
Different images/videos look best with different settings. Instead of guessing values in code, use the tuner to experiment live, then copy the settings you like.
cargo run --example webcam_tuner --features video
cargo run --example render_tuner --features video -- your_video.mp4
cargo run --example render_tuner --features image -- your_image.png
| Key | Action |
|---|---|
| D | Cycle dithering (Floyd/Bayer/Atkinson/None) |
| T | Toggle threshold (Auto/Manual) |
| +/- | Adjust threshold ±10 |
| [/] | Adjust threshold ±1 |
| B/b | Brightness +/- |
| C/c | Contrast +/- |
| G/g | Gamma +/- |
| M | Toggle color mode (Mono/Color) |
| R | Reset all settings |
| H | Help |
| Q | Quit |
| Operation | Time |
|---|---|
| Frame render (80×24) | ~2μs |
| Image load + render | ~10ms |
| 60fps animation budget | 16.6ms (we use 1.6μs) |
MIT OR Apache-2.0