Is there a way to access the pixel data of a texture?


I was wondering if there is a way to get the pixel data of a texture (that would be the color for example). I need something to get the color information of a cloud texture (brightness information).
Something like this:

texture.getColor(x, y)

wich would then return the color (rgba-vector) of the pixel at position x, y

Does anybody know if and how that can be achieved?

Thanks in advance



for example:['Tex'].image.pixels[0]


Thank you - ill try it


i’m just writing a getPixelRGBA-function… should be ready any minute now…


Ok - i have tried it.
It works for textures of type “Image”.
But i wanted it to work for textures of type “Cloud” for example. And if possible for all the other procedural textures that are build into Blender.
Python says that textures of type “Image” dont have an attribute called image - so there is no way to access image.pixels[].
Maybe the problem is that the procedural textures dont have a size - I mean they are endless and therefore it is tricky to allocate the memory for an array with size infinite. But maybe there is a way to get access to the algorithms that create the procedural textures.
I think ill give that one a try.
If anyone already knows how to achieve this - please let me know.


add a plane, apply the procedural texture, at the material settings goto shadow and set shadeless true. in the 3d-view go to the topview and press ctrl+alt+0(numpad) to set the camera. at the camera settings change perspective to orthographic and set the renderresolution to something 800:800 or whatever you need. render! then you have the image her:[‘Render Result’]

you can write a script, if you need it for more than one texture…