README
ΒΆ
π¨ TIV - Terminal Image Viewer
A fast, powerful terminal image viewer that displays images side-by-side with ASCII art. Features ANSI color support, Unicode blocks for 2x resolution, Floyd-Steinberg dithering, and inline image display. Perfect for viewing images in terminals with both original and ASCII representations simultaneously.
π§ Philosophy
Do one thing and do it well: Display images in terminals with maximum clarity.
TIV follows Unix philosophy while providing modern terminal image viewing. By default, it displays images side-by-side with ASCII conversions for the best of both worlds. For traditional workflows, use -no-split to output pure ASCII text compatible with pipes and redirection.
π¦ Installation
Pre-built Binaries (Recommended)
Download from releases page:
# Linux (x64)
wget https://github.com/e6a5/tiv/releases/latest/download/tiv-linux-amd64.tar.gz
tar -xzf tiv-linux-amd64.tar.gz
sudo mv tiv-linux-amd64 /usr/local/bin/tiv
# macOS (Homebrew)
brew install e6a5/tap/tiv
# macOS (Manual)
wget https://github.com/e6a5/tiv/releases/latest/download/tiv-darwin-arm64.tar.gz
tar -xzf tiv-darwin-arm64.tar.gz
sudo mv tiv-darwin-arm64 /usr/local/bin/tiv
From Source
go install github.com/e6a5/tiv@latest
Development
git clone https://github.com/e6a5/tiv.git
cd tiv
make build
make install # Optional: install system-wide
Usage
# Split view (default): image + ASCII side-by-side
tiv image.jpg
# Classic ASCII only
tiv -no-split image.jpg
# Pipe mode (automatically ASCII-only)
cat image.jpg | tiv
# Save ASCII to file
tiv -no-split image.jpg > ascii.txt
# Preview with pager
tiv image.jpg | less
# Invert brightness
tiv -i image.jpg
# Increase contrast for better detail
tiv -c 1.5 image.jpg
# π High resolution Unicode blocks
tiv -b image.jpg
# π¨ Professional dithering for smooth gradients
tiv -d image.jpg
# π ANSI Color Support
tiv -color 256 image.jpg # 256-color mode
tiv -color 24bit image.jpg # 24-bit truecolor
# π Ultimate quality: blocks + dithering + color + contrast
tiv -b -d -color 24bit -c 1.3 image.jpg
# πΌοΈ Show actual image in terminal (instead of ASCII)
tiv -p image.jpg # Auto-detect best preview method
tiv -p -preview-mode terminal image.jpg # Force terminal inline preview
tiv -p -preview-mode system image.jpg # Force system viewer
# Pipeline example
tiv image.jpg | head -20 | tail -10
Options
-w, --width: Output width in characters (default: 80)-h, --height: Output height in characters (auto-calculated if not set)-i, --invert: Invert brightness levels-c, --contrast: Contrast adjustment (0.5-2.0, default: 1.0)-b, --blocks: π Use Unicode block characters for 2x higher resolution-d, --dither: π¨ Apply Floyd-Steinberg dithering for professional quality--color: π ANSI color output ('256' for 256-color, '24bit' for truecolor)-p, --preview: ποΈ Show original image preview (auto-detects best method)--preview-mode: Preview mode: 'auto', 'terminal', or 'system'--no-split: Disable split view (classic ASCII-only mode)--help: Show usage information
Supported Formats
- PNG
- JPEG
πΌοΈ Terminal Image Preview
TIV can display the actual image directly in your terminal instead of ASCII art using modern terminal protocols:
Auto Mode (Default)
tiv -p image.jpg
Automatically detects terminal capabilities and chooses the best preview method.
Terminal Inline Preview
tiv -p -preview-mode terminal image.jpg
Shows the original image directly in compatible terminals using:
- Kitty Graphics Protocol: Kitty, Ghostty, Konsole
- iTerm2 Inline Images: iTerm2, WezTerm, Warp, VS Code, Tabby, Hyper, Bobcat
- Sixel Graphics: foot, Windows Terminal, Black Box, xterm
System Viewer
tiv -p -preview-mode system image.jpg
Opens the image in your system's default image viewer (Preview.app on macOS, etc.)
Supported Terminals
Based on the Yazi terminal compatibility research, TIV supports:
| Terminal | Protocol | Status |
|---|---|---|
| Kitty | Kitty Graphics | β Full support |
| iTerm2 | Inline Images | β Full support |
| WezTerm | Inline Images | β Full support |
| Ghostty | Kitty Graphics | β Full support |
| Windows Terminal | Sixel | β Full support |
| VS Code | Inline Images | β οΈ Limited support |
| foot | Sixel | β Full support |
| Konsole | Kitty Graphics | β Full support |
| Warp | Inline Images | β Full support |
| Tabby | Inline Images | β Full support |
| Hyper | Inline Images | β Full support |
| Black Box | Sixel | β Full support |
Examples
Convert and save:
tiv photo.jpg > ascii-art.txt
Use in pipelines:
find . -name "*.jpg" | head -1 | xargs cat | tiv -w 60
Quick preview:
tiv image.png | head -20
Full color with high resolution:
tiv -b -d -color 24bit -c 1.3 photo.jpg
π€ Contributing
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
- π Report bugs
- π‘ Request features
- π§ Submit PRs
π License
MIT License - see the LICENSE file for details.
π― Unix Philosophy Compliance
β Do one thing well: Converts images to ASCII text
β Handle text streams: Reads stdin, writes stdout
β Work with other programs: Pipeable and composable
β Keep it simple: Minimal interface and options
β Be portable: Plain ASCII output works everywhere
π Star History
Documentation
ΒΆ
There is no documentation for this package.