Created
September 7, 2013 06:12
-
-
Save nikitakit/6473230 to your computer and use it in GitHub Desktop.
IPython SimpleCV plugin
This file contains hidden or 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
"""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