1.9 KiB
tdiv
tdiv, or terminal dithered image viewer, is a program that allows any terminal with unicode character support to display images using braille characters. This is a simple and fast approach that allows for easy image previews, piping images as text, or getting images without X11 running. Due to the nature of this display method the images are down-scaled, turned to black and white, and then dithered with an error diffusion dither. Some images will look better than others with this approach. There are other programs that output images as half-block characters using a foreground and background color. This is also a cool approach but does not lend itself as well to piping, emailing, etc. due to the escape codes involved in the color. tdiv on the other hand can produce images that can be copied and pasted and put wherever you like.
usage
tdiv file-path [width]
Pass tdiv an image file-path (gif, png, or jpg) and it will size the image to your terminal width. If you would like a different size you can pass an optional width. This value is the width in pixels. Keep in mind that braille characters are two "pixels" wide, so if you have your terminal set to 80 columns you have a maximum of 160 pixels available to you. You may still put in a larger value, but your terminal may wrap the lines and it will likely not look great.
building
tdiv was built using golang 1.12. It may build fine on earlier versions, but has not been tested as doing so. If you have the standard Go compiler installed you should be able to build locally with make
or to install on your system run make install
(using sudo if your system needs to do so).
license
tdiv is made available under the Floodgap Free Software License. A copy of the license is included with this repository and must remain present with any further distribution or derivation of this software.