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'));
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:
It looks even better in iTerm:
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?
Top comments (0)