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

Image of Timescale

πŸš€ pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applicationsβ€”without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more β†’

Top comments (0)

Retry later
πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay