Skip to content

Instantly share code, notes, and snippets.

@nikitakit
Created September 7, 2013 06:12
Show Gist options
  • Save nikitakit/6473230 to your computer and use it in GitHub Desktop.
Save nikitakit/6473230 to your computer and use it in GitHub Desktop.
IPython SimpleCV plugin
"""Plugin to display SimpleCV images inline in the IPython notebook"""
from cStringIO import StringIO
def display_image(img):
io = StringIO()
img.save(io, 'png')
return io.getvalue()
ip = get_ipython()
png_formatter = ip.display_formatter.formatters['image/png']
png_formatter.for_type(SimpleCV.ImageClass.Image, display_image)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment