[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [35976] trunk/blender/source/blender/ makesrna/intern/rna_image.c: Image pixel acces, through Image. pixels as floating point values.

Domino Marama domino at dominodesigns.info
Mon Apr 4 18:24:49 CEST 2011


On Sun, 2011-04-03 at 16:17 +0000, Brecht Van Lommel wrote:
> Revision: 35976
>           http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=35976
> Author:   blendix
> Date:     2011-04-03 16:17:39 +0000 (Sun, 03 Apr 2011)
> Log Message:
> -----------
> Image pixel access, through Image.pixels as floating point values.

This gets unusably slow on larger images. And by "large" I mean that 256
x 256 has massive delays. The problem seems to be in the
multidimensional array reads. Writing is ok, but reads are very slow.

Just simple console testing on a 128 x 128 image takes about 10 seconds:

img=bpy.data.images.new('test', width=128, height=128)
pix = list(img.pixels)
img.pixels = pix

I've hacked a pixels_raw property (probably wrongly as I'm not a C
coder :p ) that's one long list of floats and it works much much faster.
I've attached the diff.

img=bpy.data.images.new('test', width=128, height=128)
pix = list(img.pixels_raw)
img.pixels_raw = pix

is under a second. Is it possible to get the (corrected if needed) raw
version added or replace the original with it?


-------------- next part --------------
A non-text attachment was scrubbed...
Name: pixels_raw.diff
Type: text/x-patch
Size: 841 bytes
Desc: not available
Url : http://lists.blender.org/pipermail/bf-committers/attachments/20110404/f364f683/attachment-0001.bin 


More information about the Bf-committers mailing list