Hermann Scintillating Grid Illusion

You will create the illusion below:

Hermann Scintillating Grid

Problem 4.1: Create Your Illusion

In this illusion, it looks like there are black dots, but all of the dots are white.

You should create a function that returns a MiddImage with a cafe wall illusion:

def optical_illusion(im):
    # TODO: create a hermann scintillating grid illusion

You will probably find it useful to use one of the functions that you created earlier for this assignment: filled_rectangle.

Your function must work with the size of im that is used in the test function. You must use loops in your code, do not hard-code individual pixels!

HINT: One way to compute an appropriate radius for your circle is to use the pythagorean theorem.

Problem 4.2: Set the ILLUSION Variable

In order to identify which illusion you have created, set the variable in your code as follows:

ILLUSION = "hermann_scintillating_grid"

Problem 4.3: Reflection

Please answer the following questions under the header Problem 4.3: illusion reflection:

How many times did you call the filled_rectangle function in your code? Base your answer on the image that is generated using the test function call in hw5.py.