As in PIL 1.1.4, the Image.frombuffer method supports a null copy:
Creates an image memory from pixel data in a string or buffer using a standard raw decoder. For some modes, the image memory will exchange memory with the original buffer (this means that changes to the original buffer object are reflected in the image). Not all modes can exchange memory; Supported modes include “L,” “RGBX,” “RGBA,” and “CMYK.”
The problem is that your camera data looks like 24-bit RGB, where PIL wants 32-bit RGBA / RGBX. Can you control the pixel format coming from the camera API?
If not, there may still be an advantage in using Image.frombuffer , as it will accept buffer instead of requiring you to build a python string from the pixel data.
Edit: looking at the source for frombuffer , this is a light wrapper on fromstring , and for a zero copy, the pixel format in the Image._MAPMODES (i.e. RGBX) list is Image._MAPMODES . At a minimum, you will need to copy / convert the RGB data to the RGBX buffer to get a pixel format compatible with zero copy.
I have no better way to get raw bytes in PIL, but here are some interesting links:
source share