Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Illusion: Kanizsa Square #20

Open
ujdcodr opened this issue May 22, 2024 · 2 comments
Open

New Illusion: Kanizsa Square #20

ujdcodr opened this issue May 22, 2024 · 2 comments

Comments

@ujdcodr
Copy link

ujdcodr commented May 22, 2024

Describe the solution you'd like
Screenshot from 2024-05-21 20-18-18

How could we do it?

I have figured out the core logic to produce any configuration of the illusion by altering the radius and spacing (from the edge of the image). The image in the description was generated using the following code.

from PIL import Image, ImageDraw

# Set the dimensions and background color
width, height = 500, 500
image = Image.new("RGB", (width, height), "gray")
draw = ImageDraw.Draw(image)

# Define circle radius and grid spacing
radius = 90
spacing = radius+20

# Define the centers of the circles
circle_centers = [
    (spacing, spacing),
    (width - spacing, spacing),
    (spacing, height - spacing),
    (width - spacing, height - spacing)
]

# Draw the circles
for center in circle_centers:
    draw.ellipse((center[0] - radius, center[1] - radius, center[0] + radius, center[1] + radius), "white")

# Draw the  square
square_size = width - 2*spacing 
draw.rectangle((spacing,spacing,spacing+square_size,spacing+square_size), "gray")

I need some help with understanding how to break this down like the other illusions that have already been implemented.

Some general questions:

  1. What would the illusion strength and difficulty parameters be in this illusion?
  2. What parameters would go into the corresponding _paramters.py file?
  3. For the illusions that have been implemented in the library, I see 5 files. For an initial commit, which ones should I work on?
  4. Followup to Q3, how to approach adding a new illusion as a beginner (first file to create, writing the parameter dictionary, etc.)
  5. How to verify whether the illusion is generated correctly before creating the PR?
@ujdcodr ujdcodr changed the title Kanizsa Square New Illusion: Kanizsa Square May 22, 2024
@ujdcodr
Copy link
Author

ujdcodr commented May 27, 2024

@DominiqueMakowski This is an interesting library and figuring out how to implement this illusion was an enjoyable challenge. I would like to add support for this and other illusions mentioned in the TODO items list. I would appreciate your support.

@DominiqueMakowski
Copy link
Member

Hi @ujdcodr sorry I completely missed this!!

Thanks for your interest. Indeed, interesting ideas and nice implementation of the illusion!

What would the illusion strength and difficulty parameters be in this illusion?

This is the million-dollar question. This one is tricky...
For the illusion strength, I think that this parameter should control the orientation of the white pies, so that they more-or-less form the illusory square.

image

Basically it would correspond to the angle of rotation of the circles.
Note that implementing this is tricky as it requires actually drawing each pie separately, rather than as full circles covered by a square.

All in all I'm not entirely sure that this illusion is compatible with the framework of manipulating its illusion strength...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants