OS (e.g. Win10): 11 PsychoPy version (e.g. 1.84.x): 2024.2.4
I was looking at a student’s final experiment before running participants and I noticed something strange with one of their stationary stimuli. When creating a circle polygon (units: degrees, size: (1,1), with a white border and gray fill, some weird image interpolation occurs in the “corners” of the circle. In that it almost looks like there is a black pixel on the border.
This also happens if you use two circles (one white and one gray) the same effect occurs. Changing the stimuli size(s) does remove the weird pixel artifact, but the circle becomes less “smooth”. This occurs on multiple machines running the same version of psychopy. Screen resolutions are all 1920x1080. The one computer is our main testing computer and has a 3000s series graphics card (up to date).
I also tried a custom polygon with differing amount of vertices (9999,99999,900000) and still occurs.
To clarify, this is ran locally, not online. So I assuming by “don’t use polygon borders above 20” this is referring to pixels?. The example I showed is in deg, and is approximately 39,39 pixels in size.
This would still be under the 20 pixel limit as discussed in the daily tips thread. Doesn’t psychopy just use the monitor settings (size and resolution) to find a degree → pixel conversion, then draw said objects with the appropriate pixels?
If I understand correctly, to correct both the weird artifacts and have a smoother looking circle(reducing the pixelation), I would need to always use height for stationary objects over degrees?
My understanding is that border thicknesses are in pixels, regardless of the units for the overall size. Please could you show the dimensions used for the polygon creating the artifacts.
Regardless, I believe that my screenshots that you can get sharper borders by using two disks.
I mentioned using two circles (inner and outer) but I apologize for not giving much detail. When I tried using two circle the same effect occurred. The outer circle was (1,1) and the inner was (0.92, 0.92) or (0.93, 0.93) [all in degrees]. Our monitor settings (so Psychopy can calculate degrees), are:
Resolution 1920x1080
Screen width: 60cm
Screen distance 69.5cm
In addition, using 2 disks versus 1 didn’t change the overall smoothness by any real noticeable difference. Which is why I asked if height would be the correct units to draw stationary round objects? But maybe this is just a weird edge case. However it does make write-ups a bit annoying to have to convert height to degrees (and also messing around to create the correct object size in the first place).
Issac
I wonder if there is an issue with degrees, such as the object being created small and then enlarged rather than being created at the final size. I haven’t used it as units myself, since I tend to work online and my screen scale and blind spot demos allow degrees and cm to be converted into pixels, height or norm units.
That’s kind of what I’m wondering. I have no idea how to investigate that myself. I guess for now I’ll have to mess around with the heights units and find a comparable size to degrees (specific to my settings).
You might prefer to try pixel units to height units.
However, before that, what happens if you claim your monitor is double the resolution it is really and you also double the angle.
Ditto for halving both?
Then…
What if you calculate the size in pixels and use pixel units? You could add a scaling factor in Begin Experiment like I do with screen scale so you still give the objects sizes and positions in degrees.
I think that would make our eye tracker VERY unhappy. The eye tracker grabs the screen info from psychopy, then does the math on a separate processing unit. Changing the resolution would mess up the pixel=degree conversion.
The one testing case I did was solely in pixels (r= 38-40pixels, tested each size) and I still had either the weird artifacting, or just jagged circles.
I was messing around with the polygon borders some more (line width). And I think this issue has to do with psychopy’s ability to draw line borders. Because changing it from 1->2 immediately recreates the “corners” artifact. The reason it’s not apparent at line width 5 in your post is because you use height, which means the ratio of line width to object is much smaller. Using a smaller object (1 degree in size/37-43 pixels in radius), you can start recreating the 100 line effects with a line width of 3-5 pixels in size. And a size of 1 degree is very common in visual sizes. There definitely seems to be some errors in the math psychopy does to draw line widths at anything larger than 1.