Calculate average band value in an image

I would like to create a custom script that first computes the average NDVI of the viewable pixels in a selected scene (e.g., a S-2 L2A scene). Then, I would like to subtract the average NDVI value from each pixel’s individual NDVI value. Can someone please provide some advice on how I can do so using Custom Scripts in Sentinel-Hub?

Hi @tom_howard ,

The easiest and the most straightforward way to do it is to run a statistical api request first to obtain the mean NDVI, and then run a processing api request to subtract the mean NDVI value from each pixel’s individual NDVI value.