sdl2.ext.pixelaccess - Array-like Access to SDL Surface ContentsΒΆ

The sdl2.ext.pixelaccess module offers a number of methods for reading, modifying, and copying the contents SDL surface objects.

In most cases, the Numpy-based pixels2d(), pixels3d(), and surface_to_ndarray() functions are the fastest and most flexible way of directly accessing the pixels of an SDL surface. However, the pure-Python PixelView class can be used instead to avoid adding Numpy as a dependency for your project.