Hi Lindsey,
For instance what combo of plaid_contrast and top_grating alpha do I use if I want to have a stimulus that is effectively 0.25 for the top_grating and 0.0625 for the bottom grating?
It’s not clear what you mean by “0.25 for the top_grating and 0.0625 for the bottom grating”.
Taking, say, the top grating on its own, I assume you mean a “contrast” of 0.25. I put the word in quotes, because what you’re really talking about is blending the grating’s color with a 50% gray background. For a given pixel, each RGB component resulting from this blending is determined by the equation
C_out = C_in * A + 0.5 * (1 - A)
where C_in is the original color component taken from the grating and A is the grating’s alpha multiplier. If the alpha is 1, the resulting color is just the original grating color. If the alpha is 0, the result is 0.5 (50% gray). All other values produce a mixture of the initial color and the gray background.
We can perform this blending for both the top and bottom gratings independently, resulting in two gratings with respective “contrasts” of 0.25 and 0.0625. But then how are we supposed to combine them to make the final stimulus? In other words, in the equation
C_final = C_bottom * f_bottom + C_top * f_top
where C_bottom and C_top are the pixel component color values from the bottom and top grating, respectively, what are f_bottom and f_top? Note that they need to be chosen such that C_final is in the range [0,1] for all components of all pixels. Choosing 0.5 for both f_bottom and f_top seems plausible, but I don’t know if that’s what you intend.
When I was making my example, I found it much more straightforward to think about the final stimulus in terms of the relative contributions of the top and bottom grating (plaid_top_grating_alpha) and the overall contrast of the combination of top and bottom (plaid_contrast). It may be possible to rework things to match your idea of separate “contrasts” for the top and bottom gratings, but first we need to establish how that’s supposed to work (i.e. the values of f_bottom and f_top).
Cheers,
Chris