Resize the x-axis of an image
Dear all,
for an experiment I need to show an image, but whose x- and y-axis are scaled with different values (i.e. y-axis scale = 1, x-axis scale = 2).
Is it possible to do this in opensesame?
I have tried to see if it is possible with Canvas, but it seems that there is not this possibility.
Thanks a lot for your support,
Michele
Comments
Hi @michelescandola ,
To do this, you'd need some Python script, but nothing too complicated. The script below, which you would put in the prepare phase of an
inline_scriptthat precedes thesketchpadin which you actually use the image, shows the basic idea.You first read an image from the file pool (
SRC), then you resize it to the target dimensions, and then you save it as a new image, again in the file pool (DST), which you can subsequently use in asketchpad. Does that make sense?-- Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Dear Sebastiaan,
thanks a lot.
Probably this is not the most elegant solution ever thought, but it works!
Enjoy your coffee!