So, after all, I tried something to make it work on the client side.
I followed what have suggested Kevin Ring, e.g., create an Imagery provider that contains both providers I'm interested in and try to manipulate each image received via a Canvas.
Indeed, it looks like canvas could really help me here with its globalCompositeOperation : https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation
I had my battle plan, but of course, it didn't work as easily, and now I'm stuck without understanding why it's not working.
Here's my code : https://gist.github.com/theOgrable/f18c06b2f6b233fa6794
I'm aware it is largely incomplete, if I wanted to do things the right way, I should take into account Tile size, or tilingScheme for both source and destination providers. But this is more of a test to see if it's possible right now.
Basically, I'm stuck in requestImage of this provider (line 380):
sourcePromise.then(function(image)
{
//img = image
console('drawSource');
context.drawImage(image,0,0);
});
context.globalCompositeOperation = this._gco;
sourcePromise.then(function(image)
{
console('drawDestination');
context.drawImage(image,0,0);
});
Those 'then' never execute their code (nothing in console...) so the canvas returned is not updated accordingly.
And this is what I don't understand.