Skip to content

Instantly share code, notes, and snippets.

@StevenSong
Created October 3, 2023 14:34
Show Gist options
  • Save StevenSong/2889b707320ed319b3ec3146120ec4c2 to your computer and use it in GitHub Desktop.
Save StevenSong/2889b707320ed319b3ec3146120ec4c2 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# eog not bundled with your distro?
# no sudo access?
# do it all with python!
# easiest to use with miniconda env with matplotlib
import sys
import matplotlib.pyplot as plt
from PIL import Image
figsize = 8
if len(sys.argv) == 3:
figsize = int(sys.argv[2])
im = Image.open(sys.argv[1])
fig, ax = plt.subplots(figsize=(figsize,figsize))
ax.imshow(im)
ax.set_axis_off()
fig.tight_layout()
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment