RealityBending / Pyllusion

A Parametric Framework to Generate Visual Illusions using Python
https://realitybending.github.io/Pyllusion/
MIT License
57 stars 9 forks source link

Provide full example to get image #5

Closed sand1dut closed 3 years ago

sand1dut commented 3 years ago

It is perhaps an user issue. I am using Spyder 4.0.1 with Python 3.7.9 on Windows 10. I am trying to create the images provided by you to analyze optical illusion. I have installed pyllusion and executed this code from your sample. It runs without error but I do not see any images. Can you provide a complete example on how to use this library?

import pyllusion as ill

parameters = ill.delboeuf_parameters(illusion_strength=3) ill.delboeuf_image(parameters)

Tam-Pham commented 3 years ago

Hi @sand1dut

Thank you for raising the issue.

When I run the following chunk of code in spyder, I have the image shown in the IPython Console.

import pyllusion as ill

parameters = ill.delboeuf_parameters(illusion_strength=3)
ill.delboeuf_image(parameters)

image

You might want to check your setting of Preferences > IPython Console > Graphics.

Alternatively, you can save the image into an object and call the Image.show() method in the Pillow of PIL package to display the image

import pyllusion as ill

parameters = ill.delboeuf_parameters(illusion_strength=3)
im = ill.delboeuf_image(parameters)
im.show()

Hope it helps!

sand1dut commented 3 years ago

Thank you. That worked for this novice.

sand1dut commented 3 years ago

It worked on Spyder.