Skip to main content

Hi Folks

Does anyone have a script to calculate the histogram of an image and then perform a linear contrast stretch using either pixel values or percentage clips values.


At present using a per pixel min/max stretch but this is not the usual way to enhance imagery.


Grateful of any ideas. My javascript experience is limited (but growing) any python non-exsitent.

You can do a statistical API request first to find out the min/max/historgram values

Then use stretch function.


Some further ideas can be found here:

360db83263e79cba7951e7ba15aa4495131aa0f1.pngMedium – 27 Oct 17
d520b717c52565ab0d7c0b2187f37d5580234dd1.png


Color Correction with JavaScript



Poor Man’s Atmospheric Adjustment for a Pretty Glacier Picture




Reading time: 10 min read






If you want to go into more scientific details, read this paper:

78d06371f108698f7a4f1fb203c5c78526fdac40.pngsciencedirect.com
6e4f138ff76640eab1d9df20dd75a0e7d3efd5ad.gif


Natural color representation of Sentinel-2 data



The true color composite is a widely used Earth observation product for displaying satellite imagery. As it is often used in communication with non-ex…








Reply