Creating a spotlight effect
Posted by Andy Edmonds on Feb 25, 2007
I'm trying to use a mask to simulate foveal and non-foveal vision. Imagine a spot light that reveals full resolution with the rest of the image in reduced rez.
The reduced rez is working well with:
l.adjust_brightness(0.55)
l.filter_blur(2)
Though ideally this should also reduce color depth to black and white (256 greys would be lovely).
The part I'm having a hard time with is creating a mask/blend. I made a black and white png, filled with black with a transparent circle in the middle.
Applying the following after loading
l = canvas.layer("stimulus.png")
l.adjust_brightness(0.55)
l.filter_blur(2)
m = canvas.layer("pinhole.png")
m.blend(15, mode="screen")
Results in a grey and white image, not actually transparent. What am I doing wrong?
Is there a better way to create a circular pinhole? I'd like to be able to tranform it's size and apply differing levels of brightness/blur underneath it. I'm assuming I'll clone the stimulus png for that.
Mucho gracias.
Andy
Posted by Tom De Smedt on Feb 26, 2007
Hi Andy,
Assuming I understand correctly what you want to do, try the following:
Since the mask m is a layer like any other you can scale it, move it, rotate it, etc...
Let me know if that worked for you!