Created
October 3, 2023 14:34
-
-
Save StevenSong/2889b707320ed319b3ec3146120ec4c2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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