(no title)
C4stor | 1 year ago
i2 = np.ascontiguousarray(pg.surfarray.pixels3d(isurf))
Which does the 100x speedup too and is a "safe" way to adjust memory access to numpy strides.
Whether the output is correct or not is left as an exercise to the author, since the provided benchmark only use np.zeros() it's kind of hard to verify
yosefk|1 year ago
TFA links to a GitHub repo with code resizing non-zero images, which you could use both to easily benchmark your suggested change, and to check whether the output is still correct.