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

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

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

πŸ‘‹ Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Communityβ€”every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple β€œthank you” goes a long wayβ€”express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay