I want to test some basic image processing from Maya via Python.
I’ve installed Python 2.7 and the PIL-package - and then copied the PIL folder to
X:\Autodesk\Maya2014\Python\Lib\site-packages\
Now I’m trying to multiply each pixel in an image by 1.2 using the below code:
from PIL import Image
im = Image.open(r"X: he\path est.tga")
im.point(lambda i: i * 1.2)
im.save(r"X: he\path est.tga")
However, this raises an error:
Error: The _imaging C module is not installed
…so I added another import and then tries to run the script:
from PIL import _imaging
…but then I get the error: # ImportError: DLL load failed: %1 is not a valid Win32 application.
Also, just doing a global import doesn’t fix it:
import PIL
Checked the documentation:
http://effbot.org/zone/pil-imaging-not-installed.htm
…and when just running import _imaging I get
ImportError: No module named _imaging
…which suggests that maybe “the problem might be that the module found by Python isn’t compatible with the Python interpreter”
And that would suck because as most of us know, Autodesk use their own versions of Python in Maya -_-
What to do?