I'm using scikit-image to read an image:
img = skimage.io.imread(filename)
After doing some manipulations to img
, I'd like to save it to an in-memory file (a la StringIO
) to pass off to another function, but it looks like skimage.io.imsave
requires a filename, not a file handle.
I'd like to avoid hitting the disk (imsave
followed by read from another imaging library) if at all possible. Is there a nice way to get imsave
(or some other scikit-image-friendly function) to work with StringIO
?