blessed

A curses-like library for node.js.

View on GitHub

ANSIImage (from Box)

Convert any .png file (or .gif, see below) to an ANSI image and display it as an element. This differs from the OverlayImage element in that it uses blessed’s internal PNG/GIF parser and does not require external dependencies.

Blessed uses an internal from-scratch PNG/GIF reader because no other javascript PNG reader supports Adam7 interlaced images (much less pass the png test suite).

The blessed PNG reader supports adam7 deinterlacing, animation (APNG), all color types, bit depths 1-32, alpha, alpha palettes, and outputs scaled bitmaps (cellmaps) in blessed for efficient rendering to the screen buffer. It also uses some code from libcaca/libcucul to add density ASCII characters in order to give the image more detail in the terminal.

If a corrupt PNG or a non-PNG is passed in, blessed will display error text in the element.

.gif files are also supported via a javascript implementation (they are internally converted to bitmaps and fed to the PNG renderer). Any other image format is support only if the user has imagemagick (convert and identify) installed.

Options:
Properties:
Events:
Methods: