DEV Community

Cover image for Day 23: Terminal Images πŸ–ΌοΈ
Valeria
Valeria

Posted on

5 1

Day 23: Terminal Images πŸ–ΌοΈ

Did you know that you could draw anything in a terminal?
Sure the quality would vary from one to another, but in general terminal-image works in any terminal with a colour.

It's pretty easy to use too!

Install it with your favourite package manager, e.g. deno add npm:terminal-image and create a script, e.g. main.ts:

import terminalImage from 'terminal-image';

console.log(await terminalImage.file('image.png'));
Enter fullscreen mode Exit fullscreen mode

Drop a file image.png in the same folder as script (or a .jpg if you'd like, just don't forget to change the name like I do sometimes).

Run it with e.g. deno run -A main.ts and enjoy:

ValeriaVG Logo in terminal

It looks even better in iTerm:

Clear image

Wanna know how they did it? Yup, ansi-escapes once again!

Liked the content and would love to have more of it all year long?

Buy Me A Coffee

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs