Deno.js CLI Module to Print Images on Command Line or Terminal Using TypeScript Full Project For Beginners




terminal_images is a Deno module and CLI tool, written in TypeScript, for displaying images in the terminal.

It supports PNGs, JPGs, GIFs and pixel arrays, and has support for animated GIFs and transparent images.

To install the CLI tool, run the following from the command line:


deno install --allow-read --allow-net --unstable --force


Then run







Here is an example of how you can use it:

import { printImage } from "";


 // replace this with the URL or local file path of the image you want to print out
 path: "",

 // by default the size of the image is set to fit in the terminal,
 // but you can override it with the width property
 width: 56




Property Type Description Default Value CLI Flag
path string The path or URL of the input image. No default --file or -f or the first CLI argument
rawFile Uint8Array The raw data of the input image. (You can use this instead of path) No default [No CLI flag]
rawPixels {data: Uint8Array; width: number; height: number} The rgb(a) data (as well as the height and width) of the input image. (You can use this instead of path or rawFile) No default [No CLI flag]
color boolean Whether the output should be in color. true --no-color or -n to turn off color
characterMap string | string[] See the section on character maps for more information. By default a character map isn’t used, and high-res mode is used instead. --character-map or -m
inverted boolean Whether the character map should be mapped from light to dark instead of dark to light. Normally you will want to set this to true if your terminal is in a dark theme. false --inverted or -i
width number The number of characters wide the image should be. The maximum value where all of the image is visible at once --width or -w
animationLoops number The number of times the animation loops, if the image is animated. 1 --animation-loops or -l
transparencyThreshold number The alpha threshold for considering a pixel transparent or opaque. Set to 0 to ignore transparency and 255 to set anything with even a little transparency to be completely transparent. Note that the terminal can only display completely transparent and completely opaque colors. 1 --transparency-threshold or -t


Leave a Reply