• Stars
    star
    243
  • Rank 165,955 (Top 4 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 6 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🖼 imgcat in Python (for iTerm2)

imgcat

pypi Build Status license

The imgcat CLI, written in Python (and Python API, too).

It works with iTerm2, and even inside tmux (for tmux, see Notes below).

Installation and Usage

pip install imgcat

Command-line interface (similar to iTerm2's imgcat):

$ imgcat local_image.png
$ imgcat a.png b.png c.png
$ cat from_stdin.gif | imgcat

# height is 10 lines
$ imgcat a.png --height 10

Python API:

>>> from imgcat import imgcat

# from the content of image (e.g. buffer in python3, str in python2)
>>> imgcat(open("./local_image.png"))

# or numpy arrays!
>>> im = skimage.data.chelsea()   # [300, 451, 3] ndarray, dtype=uint8
>>> imgcat(im, height=7)

# matplotlib, PIL.Image, etc.
>>> imgcat(Image.fromarray(im))

>>> import matplotlib.pyplot as plt
>>> fig, ax = plt.subplots(); ax.plot([1, 2, 3, 4, 5])
>>> imgcat(fig)

Matplotlib Backend: module://imgcat

MPLBACKEND="module://imgcat" python draw_matplotlib.py
>>> import matplotlib
>>> matplotlib.use("module://imgcat")

>>> import matplotlib.pyplot as plt
>>> fig, ax = plt.subplots()
>>> ax.text(0.5, 0.5, "Hello World!");
>>> fig.show()
# an image shall be displayed on your terminal!

IPython magic (works both in terminal and notebook)

%load_ext imgcat
%imgcat skimage.data.chelsea()

Notes

Related Projects

License

MIT License

More Repositories

1

gpustat

📊 A simple command-line utility for querying and monitoring GPU status
Python
3,994
star
2

tensorflow-talk-debugging

💬 Slides and supplementary codes for my talk 'Debugging Tips on TensorFlow' (2016)
Python
613
star
3

gpustat-web

👓 A web interface of gpustat: monitor GPU clusters at a look
Python
312
star
4

dotfiles

🏠 Personal dotfiles for *NIX systems
Lua
312
star
5

tensorflow-plot

📈 TensorFlow + Matplotlib as TF ops
Python
298
star
6

pintos

🌀 OS Coursework Project (PintOS)
C
200
star
7

TensorFlowKR-2017-talk-bestpractice

💬 Slides and Tutorial Codes for the talk 'Toward Best Practices of TensorFlow Code Patterns' (2017)
CSS
155
star
8

expt

Experiment. Plot. Tabulate.
Python
67
star
9

fzf-fasd

🌸 fzf + fasd integration
Shell
56
star
10

arxivify.sh

Generates a zip archive that is uploadable to arXiv.
Shell
45
star
11

alfred-latex-symbols-workflow

🔎 Alfred 3-4 workflow to search for latex symbol commands
Ruby
45
star
12

alfred-papers3-workflow

🔎 An Alfred 2/3 workflow to search Papers3 items
Python
43
star
13

tensorboard-tools

📉 A collection of TensorBoard-related utilities (In Progress)
Python
37
star
14

vim-typora

🗒 Vim ❤️ Typora
Vim Script
35
star
15

alfred-arxiv-workflow

🔎 Alfred workflow to search arxiv.org items
JavaScript
25
star
16

vim-autoimport

A vim plugin for adding import statements (for python and more) without LSP
Python
25
star
17

alfred-open-color-workflow

🔎 An Alfred 2/3 workflow to quickly lookup and insert open color codes
Python
22
star
18

fzf-ripgrep.vim

Vim + Fzf + Rg = Super Fast Jumper
Vim Script
19
star
19

anybar-zsh

🐚 zsh function and completion for anybar
Shell
18
star
20

latex-boilerplate

📝 A personal collection of templates for Markdown+LaTeX-based writing.
TeX
16
star
21

is_mosh

Detect whether the current shell is running under mosh
Shell
13
star
22

TensorflowKR-2016-talk-debugging

A talk on TensorFlow debugging -- REPOSITORY MOVED TO:
HTML
8
star
23

vim-python-enhanced-syntax

🐉 An experimental vim python syntax
Vim Script
7
star
24

iterm-tab-color

🎨 A command-line script to easily set iterm tab colors
Python
7
star
25

kitty-tmux

Make Kitty work better with Tmux
Python
7
star
26

toy-montezuma-pycolab

Toy Montezuma's Revenge as Pycolab and Gym environments (working in progress, NOT FULLY USABLE)
Python
6
star
27

gym-tensorflow

Gym RL environment as TensorFlow op. A fork of Uber's implementation
Python
6
star
28

imagepaste.vim

A vim plugin to paste image from clipboard and its markdown tag
Vim Script
6
star
29

nvim-profiler

A simple Lua Profiler for neovim
Lua
5
star
30

nvidia-ml-py

An unofficial, up-to-date mirror of NVIDIA's python bindings (nvidia-ml-py)
Python
5
star
31

video2gif

A command line script to convert video file to (a reasonable) GIF
Python
3
star
32

misc-stuff

Personal Miscellaneous Stuffs
Python
2
star
33

slurm-tools

A collection of useful scripts for Slurm HPC.
2
star
34

teamnote

Teamnote and code snippets for algorithm competitions including ICPC
Vim Script
1
star
35

redmine_advanced_watchers_selection

Redmine watchers selection plugin
Ruby
1
star
36

fast-syntax-highlighting

Shell
1
star