Skip to content

Instantly share code, notes, and snippets.

@bayerj
Created November 22, 2012 14:19
Show Gist options
  • Save bayerj/4131398 to your computer and use it in GitHub Desktop.
Save bayerj/4131398 to your computer and use it in GitHub Desktop.
ipython save image with pillow and display
from IPython.core.display import Image as image
from PIL import Image
def save_and_display(arr, fname):
pilimg = Image.fromarray(arr)
pilimg.save(fname)
return image(filename=fname, width=600)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment