Skip to content

Instantly share code, notes, and snippets.

@p-geon
Created August 10, 2021 09:32
Show Gist options
  • Save p-geon/34c7dc5e0f9e7760ef3d1c3c8dcc78a6 to your computer and use it in GitHub Desktop.
Save p-geon/34c7dc5e0f9e7760ef3d1c3c8dcc78a6 to your computer and use it in GitHub Desktop.
from skimage import io
import matplotlib.pyplot as plt
def imshow(img, dpi=150):
if(len(img.shape)==2):#grayscale
plt.figure(dpi)
plt.imshow(img)
plt.gray()
plt.show()
else:
plt.figure(dpi)
plt.imshow(img)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment