1
$\begingroup$

I have done lots of searching around but nothing has really answered this question directly. I want to install the Pillow library to make use of in blender. Pillow Link I want to be able to get it accessible by blender while editing and later when I export to a runtime. Anyone know how to do this

$\endgroup$
  • 1
    $\begingroup$ Be aware that this may not work. Pillow is a compiled extension, and Blender uses a nonstandard way of compiling Python. As a result, pre-built binary extensions may not be compatible (or even be available) on all platforms Blender runs on. Also, Blender can load an process images. What do you need Pillow for? $\endgroup$ – dr. Sybren Jul 11 '17 at 7:31
  • $\begingroup$ I am working on a game where levels are loaded by reading specific colour values off of a bitmap image. I am able to do this with blenders imageffmpeg function. Now I need pillow to write images so I can make a proper level edior $\endgroup$ – Alexander Gearpenguin Laevens Jul 11 '17 at 13:58
2
$\begingroup$

Use pip to install it! In the blender polder you can navigate to 2.78/bin/python(.exe) Run that and you have a typical python shell from which you can install pip the usual way (ie getpip.py). Then you can install whatever modules you like. I have used this method to intall lxml for bge use. And I have used PIL inside blender (installed with a different method though)

When exporting, all python libraries are automatically copied.

But as monster said, first investigate the bge.texture module. You can merge images, set individual pixels etc. The only thing you can't do is resize them (as fas as I know)

$\endgroup$
0
$\begingroup$

Whatever Python library you have, place it in the Python search path.

Typically the folder where the startup .blend file resides in is in the python search path. Also folders with linked data (e.g. linked groups).

$\endgroup$
0
$\begingroup$

Use the image functions in bpy.data.images to load, and bpy.types.Image objects to manipulate & save the images again. There is no need to use Pillow to manipulate images.

$\endgroup$
  • $\begingroup$ I would agree, but I need this to work during an instance in the runtime. At this time only the bge module is available to be used, and importing bpy is an error. $\endgroup$ – Alexander Gearpenguin Laevens Jul 11 '17 at 15:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.