imgcat written in Clojure
Display one or more images in iTerm2 inline. For example:
Add the following dependency to your project.clj
file
After launching the REPL in an iTerm window,
user=> (require '[clj-imgcat.core :refer [imgcat]])
user=> (imgcat "logo.png")
To display remote image,
user=> (imgcat "https://clojure.org/images/clojure-logo-120b.png")
Specify options,
width and height are given as a number followed by a unit.
; N character cells
user=> (imgcat "logo.png" :width 10)
; N pixels
user=> (imgcat "logo.png" :width "50px" :height "100px" :preserveAspectRatio 0)
; N percent of the session's width or height
user=> (imgcat "logo.png" :width "25%")
Execute via lein run
% lein run
Usage: lein run <image file>
% lein run image.png
% lein run image.png :width 50%
Execute via CLI
% clj -M -m clj-imgcat.core image.png
% clj -M -m clj-imgcat.core image.png :width 80%
Copyright (c) 2024 hisaitami
Distributed under the terms of the MIT License
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close