In pygame
I'd like to interleave two surfaces before displaying them on screen so that:
- Odd numbered lines contain pixels from surface A,
- Even numbered lines contain pixels from surface B.
In pygame
docs they say this is more efficient to do with pixelArray
, which is Surface represented as numpy
array. I did this by copying data into a new array, but the result is still very slow.
Is there a more efficient way to do this (I suppose using some numpy
method) so pixel data is accessed in original matrices, without copying every pixel?