The suggestion from m_from_space was to use im.MatrixColor, but I was pretty sure that image manipulators were not the recommended way to go forward.
Is there a way to use OpacityMatrix from inside a python function for a DynamicDisplayable? My plan is to have the value change base on an in-game variable.
So far, my in-progress code looks a bit like this:
Code: Select all
default tan_image_loc = "images/avatar/tanned.webp" default mask_image_1p_loc = "images/avatar/1p_msk.webp" init python: def tanlines1(st, at): ## The plan is to use this for different images, so those will change via variable, too tan_image = DynamicImage(tan_image_loc) mask_image_1p = DynamicImage(mask_image_1p_loc) mask_modified = ??????? ## Looking to change opacity based on in-game value - matrixcolor OpacityMatrix(mask_image_1p, 0.5)? ## Create mask img_tan = AlphaMask(tan_image, mask_modified) return img_tan, None image tannedtest1 = DynamicDisplayable(tanlines1)