RBG/Pixel Array from Grating Stim?

I am performing an experiment where I need the array of pixel intensities/colors of the entire grating stimulus for each time step. Is there a method I can call or some work around that could allow me to access this information? Also for warped stimuli as well.
Thanks

Maybe this thread explains enough: