Present an image with background
Hello everyone,
In my experiment I would like to present small image, in the middle of the screen, with a background of a different image (e.g., a cat in a background of forest).
I did the same in my last experiment but it contains a word with a background and not a pic...
In addition, i have 50 images to present and i would like to mix between them and do not build a sequential presentation.
How can i do it? How to define the images and use them in my loop? I succsfully defined the backgrounds' images but not the stimulus' images.
THANK YOU!
Comments
Hi @zohar,
if you'd like to randomize the background pictures independently of the small pictures, the way to do this is to store the filenames of the background pictures in an array, shuffle it, and then read from the shuffled array as the trials are presented. I'm a little confused because, if I understand correctly, this is the same problem you posted about your previous experiment. If so, the solution is actually the same as that I described before: https://forum.cogsci.nl/discussion/comment/24005#Comment_24005. The only different, as far as I can tell, is that in your new experiment, you'd have two pictures on your sketchpad (with the background one as the bottom one ; right click on the picture to raise or lower the picture relative to other objects on the sketchpad).
I solved a similar problem in this thread: https://forum.cogsci.nl/discussion/7391/affect-misattribution-procedure. I think that following the that description, you should be able to achieve what you're trying to do.
Hope this helps.
Fabrice.
Hi @Fab
Thank you for your answer. It is not exactly the same problem I posted earlier this year but your answer was very helpfull and the problem was solved :)
I would like to ask one more question. I built the array and add all the objects to the pool but when I run the experiment, after presented most of the targets, I got an error "object non.jpg was not found". do you know what can I do to check and to fix it? I cant find the problem source, it's look like everything is correct.
Last thing, I followed every step of your explanation and I would like to be sure that in this way each target will present only once. I have 50 targets and all of them should present once in a loop.
Thank you!
Zohar.
Hi @zohar,
Hard to tell where the error comes from without seeing the task, but that error comes up because you're calling upon a picture called "non.jpg" somewhere in your program. Is that filename correct? I.e., do you have a picture with that name in the pool? Are you sure it's "non.jpg" and not "none.jpg"? I suspect the problem might come from the code you're using to create/shuffle the array or to read information from it when your trial runs.
You could use code at different stages of your experiment to export key information to the browser's console. That would help working out when/where the error occurs exactly.
Regarding the second question: if your array contains N elements and your loop run N trials, and provided that your code pulling elements from the array on every trial is correct, then yes, each element of the array would be presented once. Best way is to run your experiment and carefully check the output.
Best,
Fabrice.