Continuously blending images by presenting them on top of each other


Author
Message
PepijnA_um
PepijnA_um
Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)Associate Member (69 reputation)
Group: Forum Members
Posts: 5, Visits: 13
Hi all,
I’m trying to set up a Gradual Onset Continous Performance Task, which is a Go/No-Go Task in which participants see a continuous gradual blending of two types of images (mountains and cities, so city-city-city-city-mountain (press)-city-city etc.) so they have to press the space bar if they see a target (e.g. mountains) appear. The individual images are supposed to be appearing over a span of 800 ms, where then the next image starts to appear on top of it (from fully transparent at 0ms to fully visible at 800ms, and subsequently being the ‘background image’ for the next image that then starts to appear on top of this over a span of 800ms). My set of stimuli consists of 48 .png versions (48*1/60Hz refresh rate = 800ms) for each stimulus image with alpha values (transparency) varying between 0 and 255. I then want to make these images being played from transparent to non-transparent, over any previous images (so that it creates this blending effect). I have successfully done this in Python (where I can draw two stimuli on top of each other), but Inquisit does not seem to have a straightforward approach of presenting two images (e.g. 1 saturated with an overlapping transparent .png) at the same time? I have created a script that presents the two images but it does not seem to work (they seem to be presented directly after each other but not at the same time).
Does anyone have suggestions on how to achieve this gradual blending effect?
I have appended a shortened version of my script, with only 1 stimulus read-in "mountain_9.png" that I want to make appear on top of another (saturated/non-transparent) image “city_1_g.jpg".

Thank you for your input!

<block myblock>
/ trials = [1-3=mytrial]
</block>

<trial mytrial>
/ontrialbegin = [trial.mytrial.insertstimulustime(list.masklist.nextvalue,0);
trial.mytrial.insertstimulustime(list.masklist.nextvalue,13);
trial.mytrial.insertstimulustime(list.masklist.nextvalue,26);
.
. Comment: In total 48x
.
trial.mytrial.insertstimulustime(list.masklist.nextvalue,767);]
/ontrialend = [list.masklist.reset(); trial.mytrial.resetstimulusframes();]
/stimulustimes = [0=mypicture; 13=mypicture; 26=mypicture;
.
. Comment: Again here 48x
.
767=mypicture]
/beginresponsetime = 0
/validresponse = (57,noresponse)
/timeout = 800
</trial>

Comment: Previous image as background (in this case just presented in its fully non-transparant form)
<picture mypicture>
/ items = ("city_1_g.jpg")
</picture>

<list masklist>
/items = (picture.p5 …. until, picture.p255)
/selectionmode = sequence
/selectionrate = always
</list>

Example stimulus read in (in real life 48 versions of multiple images, here just for mountain_9)
<picture p5>
/items = ("mountain_9_g_5.png")
</picture>
.
. 48x
.
<picture p255>
/items = ("mountain_9_g_255.png")
</picture>


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
PepijnA_um - 4 Years Ago
Dave - 4 Years Ago
PepijnA_um - 4 Years Ago
Dave - 4 Years Ago
                     Hi, I have attached the complete script and images....
PepijnA_um - 4 Years Ago
                         Thanks. I don't understand the setup of the script you attached. You...
Dave - 4 Years Ago
                             I based this on an example my supervisor sent me in which a...
PepijnA_um - 4 Years Ago
                                 > The difference in number of images is because there is a...
Dave - 4 Years Ago
                                     With your adaptation it looks smooth to me as well, thanks!
PepijnA_um - 4 Years Ago

Reading This Topic

Explore
Messages
Mentions
Search