How to create a bitmap from the BabylonJS WebGL render canvas?

I suppose I am not the first guy trying to get an image of what BabylonJS renders.
In my case I would like to post-process the screen display, something like:
engine.runRenderLoop(function () {
doPostProcess(); })
Extracting such a way, a screen bitmap during Post-processing, could be to save a screen shot.
It could also be used to clip the scene along a fancy path.

In my case, it is in the framework of a framework supported by the French MOE, about creating
holographic views of mathematical objects (think of the simple case of e.g. polyhedra).
Here I need to clip against an isosceles right triangle and then assemble 4 views of the scene to make a holographic pyramid (3D hologram – a short, simple explanation).
I have tried to have an independent 2D canvas of the same size and same location as the WebGL canvas use by Babylon in the hope the get the image data with a call of type
ctx.getImageData(0, 0, w,h). Unfortunately it does not work because the WebGL pixels belong (at least as I imagine) in a world completely different from the 2D canvas.
Any idea would be more than welcome. Jean-Marie L.


Here is a doc about it: Render a Scene to a PNG - Babylon.js Documentation