psychopy.org | Reference | Downloads | Github

Experiment involves using images as masks

URL of experiment:

Description of the problem: I have created an experiment in PsychoPy and it runs well, but when I tried to pilot it online I got this error:

when setting the image of ImageStim: image_test
when getting the value of resource: color
unknown resource

I color images by using them as masks. I was wondering is it possible to run it online when I’m using this function? Thank you.

“Unknown resource” has cropped up a lot on the forum (worth using search first). It usually indicates that your stimuli and/or conditions files haven’t uploaded (e…g because the file name is define by some code and PsychoPy couldn’t pre-compute it. Try checking the html/resources folder to see if all the necessary files are there.

But, in future, do please search before asking, and also add the URL of your experiment (code or running) so we can check it directly

Hi @jon ,

Thanks for the reply. I’ve checked the resource folder and all the necessary files are there. Sorry I didn’t describe my problem clearly.

This is a memory test. For each image, participants will need to do an old new judgment. If they recognize an image, they’ll need to do some further memory tests, such as the color of the image. The error appears in the color routine in which I’m using images as masks and using a slider for participants to change the color of each image.

It might be more straightforward if you could have a look at the code. Thank you so much in advance. https://gitlab.pavlovia.org/xiaotong/next-day-test

To be more specific

var colortestComponents;
function colortestRoutineBegin() {
  //------Prepare to start Routine 'colortest'-------
  t = 0;
  colortestClock.reset(); // clock
  frameN = -1;
  // update component parameters for each repeat
  image_test.color = [1, 0, 1]
  slider.reset()
  **image_test.setImage('color');**
  image_test.setMask(Test_ImageItem);
  keycontinue.keys = undefined;
  keycontinue.rt = undefined;

The line in bold got an error. This line is corresponding to the following settings in PsychoPy:


I have no idea what went wrong. Any suggestions would be appreciated!