makeTxtrFromImg.m: Creates PTB-compatible image for drawing.

In PsychToolBox, in order to display an image onto the screen, you must first load the image file (typically a jpeg, png, or bitmap) into MATLAB, and then convert it into what is called a "texture." in PTB. This is jargon for a PTB-readable format that allows it to be easily drawn onto a display screen.

It's a very simple function, but it saves a few lines of code, and saves me from having to remember how to do it every time. It's also guaranteed to be typo-free, assuming you've specified the file information properly. Woo!

See the help notes in the function below for usage.

return to main page