OpenGLContext.debug.bufferimage

Create PIL images from depth or stencil buffers
This module allows you to capture the current depth or stencil buffer to a PIL image. This allows you to, for instance, save the image to disk and examine it with an image editor to confirm that the buffer includes the expected results.

Functions