OverlayImage (from Box)

Display an image in the terminal (jpeg, png, gif) using w3mimgdisplay. Requires w3m to be installed. X11 required: works in xterm, urxvt, and possibly other terminals.

Options

  • Inherits all from Box.
  • file - Path to image.
  • ansi - Render the file as ANSI art instead of using w3m to overlay Internally uses the ANSIImage element. See the ANSIImage element for more information/options. (Default: true).
  • w3m - Path to w3mimgdisplay. If a proper w3mimgdisplay path is not given, blessed will search the entire disk for the binary.
  • search - Whether to search /usr, /bin, and /lib for w3mimgdisplay (Default: true).

Properties

  • Inherits all from Box.

Events

  • Inherits all from Box.

Methods

  • Inherits all from Box.
  • setImage(img, [callback]) - Set the image in the box to a new path.
  • clearImage([callback]) - Clear the current image.
  • imageSize(img, [callback]) - Get the size of an image file in pixels.
  • termSize([callback]) - Get the size of the terminal in pixels.
  • getPixelRatio([callback]) - Get the pixel to cell ratio for the terminal.
  • Note: All methods above can be synchronous as long as the host version of node supports spawnSync.

Last update: February 22, 2020