Combining OpenLayers raster and vector layers for cropping and masking
Openlayers contains the powerful feature which enables you to combine 2 (or more) raster layers using a custom function with access to the pixels of each layer.
As vector layers can also be rendered as raster using the renderMode:image, this can be used to implement client side cropping and/or masking based on any shape.