Is it possible to generate an image using Python in UPBGE?

Is it possible to generate an image with Python in UPBGE without a texture, and save it? Like the makeScreenshot module, but more controllable?