Images

Functions

Functions for displaying images inline in iTerm2.

See https://iterm2.com/images.html.

iterm2_tools.images.display_image_bytes(b, filename=None, inline=1)[source]

Display the image given by the bytes b in the terminal.

If filename=None the filename defaults to “Unnamed file”.

iterm2_tools.images.display_image_file(fn)[source]

Display an image in the terminal.

A newline is not printed.

iterm2_tools.images.image_bytes(b, filename=None, inline=1)[source]

DEPRECATED: Use display_image_bytes.

Shell sequences

images.IMAGE_CODE = '\x1b]1337;File=name={name};inline={inline};size={size}:{base64_img}\x07'