Color modulating each half of an image a different color

Hi All,

As per the title, I was wondering if there was a way to color modulate half an image one color and the other half a different without having to split the image into two different parts? 


I understand that the code below is a way to modulate the color of the entire image, but am unable to find a function that does what I require.


Screen('DrawTexture', window, imageTexture, [], [], 0, [], [], [0 0 1]); 

 

Any help would be really appreciated!

Kind Regards,

Alex

Why can’t you split the image into two different parts?


On Nov 21, 2016, at 12:59 AM, alexhrrobinson@... [PSYCHTOOLBOX] <PSYCHTOOLBOX@yahoogroups.com> wrote:


Hi All,

As per the title, I was wondering if there was a way to color modulate half an image one color and the other half a different without having to split the image into two different parts? 


I understand that the code below is a way to modulate the color of the entire image, but am unable to find a function that does what I require.


Screen('DrawTexture', window, imageTexture, [], [], 0, [], [], [0 0 1]); 

 

Any help would be really appreciated!

Kind Regards,

Alex



Note that to split the image, you do not have to make two separate images on disk or in matlab. Simple play with the source- and destination rects in the draw texture call. That should be straightforward, and minimal overhead.
Cheers,
Dee


On Nov 21, 2016 6:38 PM, "Keith Schneider keithas@... [PSYCHTOOLBOX]" <PSYCHTOOLBOX@yahoogroups.com> wrote:


Why can’t you split the image into two different parts?


On Nov 21, 2016, at 12:59 AM, alexhrrobinson@... [PSYCHTOOLBOX] <PSYCHTOOLBOX@yahoogroups.com> wrote:


Hi All,

As per the title, I was wondering if there was a way to color modulate half an image one color and the other half a different without having to split the image into two different parts?


I understand that the code below is a way to modulate the color of the entire image, but am unable to find a function that does what I require.


Screen('DrawTexture', window, imageTexture, [], [], 0, [], [], [0 0 1]);


Any help would be really appreciated!

Kind Regards,

Alex