I wonder if there is any way for Babel in Org Mode to display images (from libraries like Pillow or matplotlib) "directly" without saving them into a file:

#+begin_src python
from PIL import Image
filename = 'sample-image.png'

img = Image.open(filename)

return img

However, the result is only:

: <PIL.PngImagePlugin.PngImageFile image mode=RGB size=3000x1622 at 0x7F65C7170E10>

Org mode documentation has a few examples how to show images saved into a file, but I wonder if it's possible to return them from a running code directly?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.