Psychtoolbox MakeTexture

I was just having a problem with MakeTexture in Psychtoolbox. I like to use
PsychImaging(‘AddTask’, ‘General’, ‘NormalizedHighresColorRange’);
so that black=0 and white=1, not 255. This makes my code transfer easily to high-bit-depth devices like my DATAPixx. But I was having a problem that MakeTexture would only work with the 0-255 colour range. Argh what a pain! But thankfully googling revealed that this was my mistake.

“— In, “IanA” wrote:
Answering my own question, I realised after I posted it that MakeTexture
requires a bitdepth passed to it explicitly, and then the normalised range works
as expected. I had expected the default (0) to follow the window itself, but
reading the documentation properly 😉 see the default is 8bit.

So I just needed to do
tex=Screen(‘MakeTexture’, window, imageMatrix,[],[],1);
instead of
tex=Screen(‘MakeTexture’, window, imageMatrix);
and it all worked. Love Psychtoolbox!

Leave a Reply

Your email address will not be published. Required fields are marked *