omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    [Lab] strange visual effect trying to create a radial blur

    Pythonista
    blur illusion optical radial lab
    1
    1
    1611
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Phuket2
      Phuket2 last edited by

      I got a very strange optical illusion with the code below. Was trying to make a radial blur effect. Is interesting.

      '''
      	Pythonista Forum - @Phuket2
      '''
      import ui
      
      class MyClass(ui.View):
      	def __init__(self, *args, **kwargs):
      		super().__init__(*args, **kwargs)
      	
      	def draw(self):
      		wh = 100
      		r = ui.Rect(0, 0, wh, wh)
      		r.center(self.bounds.center())
      		s = ui.Path.oval(*r)
      		rd = 1
      		for i in range(int(r.width)):
      			s = ui.Path.oval(*r)
      			s.line_width = 1
      			c = (0,  rd, 0, 1)
      			ui.set_color( c)
      			s.stroke()
      			r = r.inset(.5, .5)
      			rd -=.01
      		
      
      if __name__ == '__main__':
      	w, h = 320, 480
      	f = (0, 0, w, h)
      	
      	mc = MyClass(frame=f, bg_color='white')
      	mc.present('sheet', animated=False)
      

      If you change rd -= .01, to rd -= .02 then you get the below

      Sort of looks like a radial blur. But with rd-=.01 you get a wacky illusion. Just for fun

      1 Reply Last reply Reply Quote 0
      • First post
        Last post
      Powered by NodeBB Forums | Contributors