psychopy.org | Reference | Downloads | Github

Visual stimulus edges appear blurred

Hi to all! :space_invader:

Description of the problem:

Edges of the visual stimuli appear blurred in online experiment:
dot
The stimuli are initiated with the following code:

  // Initialize components for Routine "distr_1_1"
  distr_1_1Clock = new util.Clock();
  batch1_1_distractor = new visual.Polygon ({
    win: psychoJS.window, name: 'batch1_1_distractor', units : 'pix', 
    edges: 100, size:[74, 74],
    ori: 0, pos: [0, 0],
    lineWidth: 1, lineColor: new util.Color([1, 1, 1]),
    fillColor: new util.Color([1, 1, 1]),
    opacity: 1, depth: 0, interpolate: true,  
  });

How do I make the outer line of the circe look smooth?

Thanx in advance!

I think the circle looks like this because it’s drawn a polygon with 100 vertices. You could increase the number of vertices, but you might get nicer results by using an image of a circle instead.

1 Like

Thanx Thomas! I’m gonna try both solutions

1 Like

Well, the first solution did not work - I increased the number of vertices to 500 and the stimuli still look pretty much the same :hugs: The second solution is not suitable in fact for my experiment, since I have to generate hundreds of images based on the trial conditions based on the conditions file…
Is it some kind of anti-aliasing mechanism that is required here? Thnks! :innocent:

Hmmm… then we might need something funkier; let me ask around. Meanwhile, what varies between all those circles you need to draw?

Hello Thomas! What is varied between the circles is their color.

Hello all, I am forwarding this message again.

Thanx!

Hi @toto, do you mean that the circle edges are pixelated ie. there is no antialiasing?
If so you may be interested in the issue I created today on psychopy’s github page:

I’ve managed to solve that issue by creating the window object with different parameters (see the issue above, the solution was suggested here) - this can not be done in the Builder directly unfortunatelly (AFAIK). But you could add a code component that replaces automatic builder window with a custom one. Let me know if you need help with that.