[Bf-python] Image.getPixelColor

Jonathan Merritt j.merritt at pgrad.unimelb.edu.au
Sat Apr 30 07:33:22 CEST 2005


Hi Austin,

This sounds like great work. :-)  I've also been wondering if some kind
of inter-operability could be achieved between Blender Images and Python
Imaging Library (PIL) images.  Many people working with images and
Python will be familiar with PIL.  It can achieve many things that will
probably always be beyond the scope of Blender's image API.

I was wondering if you knew of any inter-operability issues that might
be addressed while you're working on your current code?  Perhaps
following PIL conventions for certain things?  (I'm not sure what
conventions should be taken into account; that's why I'm asking if
you've looked into it. :-)

Obviously Blender needs its own internal binary representation of an
image, but it would be nice if there were some kind of
(semi-)transparent way of using PIL images or the data they contain. 
Maybe this could be done using the Python sequence protocol as an
intermediary?  What do people think?

What I have in my head here is the easy cooperation that exists between
normal Python lists of floats or integers, and numarray arrays (
numeric.scipy.org ).  I think it would be great if we had a similar easy
level of interchange between PIL and Blender.

Jonathan Merritt.


Austin Benesh wrote:

>Ok, the documentation is up and the first patch can be trashed.
>The new patches:
>
>getpixels.diff
>imagedoc_update.diff
>
>Here's what I fixed:
>
>- stupid comments
>- patch not working
>- Max_xy is now MaxXY
>- extra debug code and junk like that
>
>Here's what I still need to add:
>
>- getMinXY
>- setPixelColor (might require an Image.save())
>- any additional operations
>
>Please say if there is anything more that may need fixing or adding.
>  
>



More information about the Bf-python mailing list