Convert PILLOW image into StringIO

I’m writing a program which can receive images in a variety of common image formats but needs to examine them all in one consistent format. It doesn’t really matter what image format, mainly just that all of them are the same. Since I need to convert the image format and then continue working with the image, I don’t want to save it to disk; just convert it and continue on. Here’s my attempt using StringIO:

image ="RGB")
cimage = cStringIO.StringIO() # create a StringIO buffer to receive the converted image, format="BMP") # reformat the image into the cimage buffer
cimage =

It returns the following error:

Traceback (most recent call last): File "", line 77, in <module> s.listen_forever() File "", line 47, in listen_forever asdf = self.matcher.get_asdf(data) File "/Users/jedestep/dev/hitch-py/hitchhiker/", line 26, in get_asdf cimage = File "/Library/Python/2.7/site-packages/PIL/", line 2256, in open % (filename if filename else fp))
IOError: cannot identify image file <cStringIO.StringO object at 0x10261d810>

I’ve also tried with io.BytesIO with the same results. Any suggestions as to how to approach this?