-
Notifications
You must be signed in to change notification settings - Fork 9
Image_Pixels
Dealga McArdle edited this page Oct 25, 2015
·
6 revisions
Blender comes with numpy built in. yep!
import math
import numpy as np
import bpy
def np_array_from_image(img_name):
img = bpy.data.images[img_name]
return np.array(img.pixels[:])
pixelsA = np_array_from_image('A')
pixelsB = np_array_from_image('B')
pixelsC = np_array_from_image('C')
pixelsD = (pixelsA + pixelsB + pixelsC) / 3
image_D = bpy.data.images['D']
image_D.pixels = pixelsD.tolist()
# then click in the UV editor / to update the view..to see the pixels of `D` updated
# add smallest element values
interim_1 = np.minimum(pixelsA, pixelsB)
pixelsD = np.minimum(interim_1, pixelsC)
Introduction
Objects / Mesh / BMesh
- Empty - null object
- Mesh
- Bmesh
- bmesh.ops - primitives
- bmesh.ops - mesh opsπ§
- Curves (2d, 3d)
- Text (Font Objects)
- Duplication (instancing)
- Metaballs
Time and Motion
- scripted keyframesπ
- Event Handlersπ
- Drivers
Miscellaneous bpy.data.*
Order / Organization
- Groupingπ
- Parentingπ
- Layers
- UI / Layoutπ
Miscellaneous
- Mathutilsπ
- Modifiersπ
- Particle Systemsπ
- vertex colorsπ
- Textures UV DPI
- Propertiesπ§
- Operators (and callbacks)π§
- bgl / blfπ
- Grease Pencil
- Themes
- Areas
Add-ons
- introductionπ
- import / exportπ
- Text Editorπ
- Custom Nodesπ