
- set the image filter
FilterBGR24():
- Switches the Red and Blue color channels. Red becomes blue. Blue becomes red.
- Creates a Bluescreen effect. Blue pixels are rendered transparent.
- Applies a custom color filter to the image.
- FilterColor().matrix
Matrix provides general color transformation filter.
Resulting color values are calculated using matrix 4×5.
Every matrix row contains parameters for one color channel calculation.
Order of rows: red, green, blue, alpha.
Parameters in row define coefficients for source color channels in same order.
- Converts image to grayscale.
- Filter for levels calculations.
- FilterLevel().levels
- Converts the images to normal maps.
- Resets the color channels. Red becomes Red. Green becomes Green. Blue becomes Blue.
- Uses the Blender 3D color sliders to set the Filter's Red, Green, Blue and Alpha channels.

###################### set filter
# import bge module
import bge
# get current scene
scene = bge.logic.getCurrentScene()
# get list of objects in scene
objList = scene.objects
# get object named Mirror
obj = objList["Mirror"]
# get the mirror material ID
# Name of my Mirror material is Reflect
matID = bge.texture.materialID(obj, "MAReflect")
# get a list of the cameras
camList = scene.cameras
# get the camera named PlayerOne
cam = camList["PlayerOne"]
# texture I'm using for the mirror is in first texture channel
texChannel = 0
# get the texture
mirror = bge.texture.Texture(obj, matID, texChannel)
# get the mirror source
mirror.source = bge.texture.ImageMirror(scene, cam, obj, matID)
# set grayscale filter
mirror.source.filter = bge.texture.FilterGray()
# save mirror as an object variable
obj["Mirror"] = mirror
# update mirror
mirror.refresh(True)