psychopy.org | Reference | Downloads | Github

Masked images varying in size (psychjs)

PsychoPy 1.9.3, JavaScript [I can’t go to 3 as it doesn’t produce HTML for my server]

Hi, I’ve a problem with creating stimuli that are a specified size.

I’ve a pair of images, both identical in size [223 x 149], one is a texture and the other a monochrome mask used to present a particular shape wearing the texture. When I place the image on the screen (see code below) the textured shape seems to vary in size, despite the mask being the same size as the image and the image having a specified size which is also the same. Am I misunderstanding the functionality of the image & masks ?

      targSize = [223, 149];}
      ...
      target.setMask(psychoJS.resourceManager.getResource('masks/' + maskName + '.png'));
      target.setPos(pos);
      target.setImage(psychoJS.resourceManager.getResource(targetName));
      target.setSize(targSize);

NB. There are eight pairs of images, each pair has a different targSize - however I’m always loading the image and mask at the same time.
NB2. Units are set to ‘pix’

Anyone have any suggestions?