[Bf-committers] pixel get & image processing

Daniel Salazar - 3Developer.com zanqdo at gmail.com
Tue Jan 25 20:14:35 CET 2011


Very nice, You think is it better to access the image directly instead
of generic access to textures? that way we could get values from
procedurals too

cheers

Daniel Salazar
www.3developer.com



2011/1/25 Sebastian Korczak <admin at myinventions.pl>:
> I have done simple PATCH  for accessing pixel color from image/video.
>
> here is the patch: http://www.pasteall.org/18582/diff
>
> I am using this for 3D scanner Add-on :)
>   http://en.myinventions.pl/index.php?page=Blender3DscannerConcept
>
> You can also use it for:
>  * make meshes from blue prints
>  * motion capture
>  * any other image processing you need
>
>
> PATH creates new properties:
>   bpy.types.Image.frame
>   bpy.types.Image.pix_x
>   bpy.types.Image.pix_y
>   bpy.types.Image.pixel_color (read only)
>
>
> Example usage:
>  bpy.data.images['video'].frame = 2       # set video frame to process
>  bpy.data.images['video'].pix_x = 5       # set x coordinate of pixel
>                                            # we want to access
>  bpy.data.images['video'].pix_y = 10      # set y coordinate of pixel
>                                            # we want to access
>  bpy.data.images['video'].pixel_color[0] # returns red channel (0-255)
>  bpy.data.images['video'].pixel_color[1] # returns green channel (0-255)
>  bpy.data.images['video'].pixel_color[2] # returns blue channel (0-255)
>  bpy.data.images['video'].pixel_color[3] # returns alpha channel (0-255)
>
>
> Any chances to put it into official release? I will publish 3D scanner
> add-on this year.
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
>


More information about the Bf-committers mailing list