It is starting to be a FAQ, people asking for Processing to be headless, on the server side, etc.
Processing isn't designed for such usage, its root is an Applet, a visual object with a life cycle specific for display.
Somehow, its code could have been organized to make little dependency on the Applet side, and around a headless core. That's partly the case around the central PGraphics, but still all functions has roots in the PApplet.
Looking closer, you can actually use PImage and PGraphics with some care (don't rely on having a default font, don't use save()) without the parent PApplet, they are quite self-sufficient, if you call their functions directly.
For lot of functions, PApplet is only a proxy passing the parameters to the default PGraphics (and other similar classes).