chafa is a terminal image viewer and converter. Converts images to ANSI art, Unicode blocks, or sixel graphics for display in terminals.
Basic Usage
- chafa <image> - Display image in terminal
- chafa -f <format> <image> - Specify output format
- chafa -s <size> <image> - Set output size
- chafa -c <colors> <image> - Set color mode
Output Formats
- chafa -f symbols <image> - Unicode symbols (default)
- chafa -f sixel <image> - Sixel graphics
- chafa -f kitty <image> - Kitty terminal protocol
- chafa -f iterm2 <image> - iTerm2 protocol
- chafa -f none <image> - No output (for testing)
Size Options
- chafa -s <width>x<height> <image> - Set dimensions
- chafa -s <size> <image> - Set size (width only, auto height)
- chafa -s auto <image> - Auto size based on terminal
- chafa -s max <image> - Maximum size
Color Options
- chafa -c 16 <image> - 16 colors
- chafa -c 256 <image> - 256 colors
- chafa -c full <image> - Full color (24-bit)
- chafa -c none <image> - No color (monochrome)
Display Options
- chafa --animate <image> - Animate GIF/APNG
- chafa --center <image> - Center image
- chafa --bg <color> <image> - Set background color
- chafa --fg <color> <image> - Set foreground color
- chafa --dither <mode> <image> - Set dithering mode
- chafa --threshold <value> <image> - Set threshold for symbols
Common Examples
Basic Display
chafa image.png
Display image in terminal.
Custom Size
chafa -s 80x40 image.png
Display at specific dimensions.
Sixel Format
chafa -f sixel image.png
Use sixel graphics format.
Full Color
chafa -c full -s 100 image.png
Full color at 100 width.
Animated GIF
chafa --animate animation.gif
Display animated GIF.
Monochrome
chafa -c none image.png
Display in monochrome.
Tips
- Use -s auto for automatic sizing based on terminal
- Use -c full for best color quality in modern terminals
- Use -f sixel for better quality in terminals that support it
- Use --animate to view animated images
- Works great with image previewers in file managers
- Can be piped to other commands for processing
- Supports many image formats: PNG, JPEG, GIF, WebP, etc.