Without knowing further deatils, I would use scipy.misc.imread . Scipy uses Pillow , which in turn uses mmap :
>>> from scipy import misc
>>> pix_array = misc.imread('image_fname')
>>> type(pix_array)
<type 'numpy.ndarray'>
>>>
>>> misc.imsave('altered_image_fname', altered_pix_array)
If it scipy.misc.imreaddoes not work right from the window, try pip install pillowinstalling / reinstalling Pillow correctly . GL + HF
source
share