Custom visualization of Sentinel 1 VV

Greetings

I would like to change the visualization of Sentinel 1 VV in dB by using another threshold (change the [-20,0] to other values). The area of interest is the ocean so the goal is to have a rich dynamic range at sea, even at the cost of having saturated values in land areas. I would also like to apply multilooks to reduce the speckle (by using spatial average with a determined pixel window of 3x3, 6x6, etc). I have the Matlab script but I am not familiar with Javascript or the functions that can be used in EO Browser. Would you be so kind to help me?

Thank you

The basic stretch function is described here:
https://www.sentinel-hub.com/faq/how-manually-configure-stretch-images

If you paste Matlab function (hopefully not too complex), we can try to help porting it to Javascript.