Render images and video previews as Braille art in the terminal with color and animation support.
Project description
dotz
Render images and video previews as Braille art in the terminal with xterm-256 color and ncurses dim/normal/bold attributes.
It was written to be used as a terminal image viewer with nnn. Works independently too.
Features
- Braille art rendering for images
- Animated GIF support
- xterm-256 color and grayscale
- Dithering options (ordered, error diffusion)
- Video preview (frame extraction with ffmpeg)
- Keyboard navigation and slideshow mode
Installation
Install the required dependencies and the dotz command:
# Install system dependencies (e.g., ffmpeg)
sudo apt-get install ffmpeg # or use your OS package manager
# Install Python dependencies and the CLI tool
sudo pip3 install .
After installation, you can run the tool using:
dotz [options] <file-or-directory>
Usage
usage: dotz [-h] [-S] [-C] [-d {ordered,error,none}] [-s [DELAY]] [-k SEEK] [-f {jpeg,png}] [path]
Render an image or all images/videos in a directory as Braille cells using ncurses with optional xterm-256 color.
positional arguments:
path Path to the image/video file or directory (optional)
options:
-h, --help show this help message and exit
-S, --no-sharpen Disable edge sharpening
-C, --no-color Disable color (greyscale only with dim/normal/bold)
-d {ordered,error,none}, --dither {ordered,error,none}
Dithering mode: ordered (default, clean), error (Floyd-Steinberg, smooth gradients), none
-s [DELAY], --slideshow [DELAY]
Enable slideshow mode with optional integer delay in seconds (default: 5).
-k SEEK, --seek SEEK Seek position to extract frame from videos in seconds (default: 10)
-f {jpeg,png}, --format {jpeg,png}
Format for extracted video frames: jpeg (default) or png
Examples
- Syntax:
python -m dotz <file-or-directory>
- To render a single image:
python -m dotz path/to/image.jpg
- To render all images and videos in a directory:
python -m dotz path/to/directory/
- To run a slideshow with a custom delay (e.g. 3 seconds):
python -m dotz -s 3 path/to/directory/
Navigation
| Key | Action |
|---|---|
| Right, l, Space | Next |
| Left, h | Previous |
| Up | First |
| Down | Last |
| s | Toggle slideshow |
| S | Toggle reverse slideshow |
| q, Esc | Quit |
Dependencies
| Package | Version | Usage |
|---|---|---|
| python | >=3.7 | Required Python version |
| numpy | >=1.20 | Fast array operations for image processing |
| Pillow | >=8.0 | Image loading and manipulation |
| ffmpeg | >=4.2 | Video frame extraction |
Formats
Image: PNG, JPG, JPEG, BMP, GIF, TIFF, WEBP
Video: MP4, MKV, AVI, MOV, WEBM, FLV, WMV, MPEG, MPG
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dotz-0.1.tar.gz.
File metadata
- Download URL: dotz-0.1.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a08085f9168e78d20beff3a0c604946a683efca9916c7a8b61bbfc8c1d81ca20
|
|
| MD5 |
faddb2cd535d35ee63bd6291b45cd4ea
|
|
| BLAKE2b-256 |
a4b0e76ac6b86507c7c2e1199475f223853124348aef771c94451e6c9fb3f7dd
|
File details
Details for the file dotz-0.1-py3-none-any.whl.
File metadata
- Download URL: dotz-0.1-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e0a431e569b6740afabadcf8c7bc29f44f574e39fb1b20b7c4cb3973b6d551b
|
|
| MD5 |
7be750ef20dd3f1f32cc917639629d71
|
|
| BLAKE2b-256 |
5c63b4f608a85c171701b4cd5e234f1c82832a1e311d1f2fa50df7fa579b11b2
|