Skip to content

Commit 1714b7d

Browse files
author
Monja Šebela
committed
Adding a new script by Marko Repše
1 parent 5c862ce commit 1714b7d

File tree

4 files changed

+60
-0
lines changed

4 files changed

+60
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ Dedicated to supplying data for [Copernicus services](http://www.esa.int/Our_Act
9393
- [Global mosaic best pixel selection script](sentinel-2/s2gm)
9494
- [TOA Ratio B09-B8A ColorMap Blue-Red & Natural Colours Script](sentinel-2/ratio_b09-b8a_colormap_blue_red_v0.1)
9595
- [Tonemapped Natural Color script](sentinel-2/tonemapped_natural_color)
96+
- [Highlight Optimized Natural Color](Sentinel-2/highlight_optimized_natural_color)
9697
- [Vegetation condition index ](sentinel-2/vegetation_condition_index)
9798

9899
#### Cloud detection algorithms
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Highlight Optimized Natural Color Script
2+
3+
<a href="#" id='togglescript'>Show</a> script or [download](script.js){:target="_blank"} it.
4+
<div id='script_view' style="display:none">
5+
{% highlight javascript %}
6+
{% include_relative script.js %}
7+
{% endhighlight %}
8+
</div>
9+
10+
## Evaluate and visualize
11+
- [EO Browser](https://apps.sentinel-hub.com/eo-browser/?lat=-51.0021&lng=-73.3260&zoom=11&time=2019-05-08&preset=CUSTOM&datasource=Sentinel-2%20L2A&layers=B01,B02,B03&evalscript=cmV0dXJuIFtNYXRoLmNicnQoMC42KkIwNCksCiAgICAgICAgTWF0aC5jYnJ0KDAuNipCMDMpLAogICAgICAgIE1hdGguY2JydCgwLjYqQjAyKV0%3D){:target="_blank"}
12+
13+
14+
## General description of the script
15+
16+
This script aims to display the Earth in beautiful natural color images. It uses highlight optimization to avoid burnt out pixels and to even out the exposure. The script was inspired by the [Tonemapped Natural Color Script](https://custom-scripts.sentinel-hub.com/sentinel-2/tonemapped_natural_color/){:target="_blank"}. The script is very simple, needing only 3 code lines.
17+
18+
For Sentinel-2 L2A, the script only uses bicubic root and lowers the values of the true color bands:
19+
20+
```javascript
21+
return [Math.cbrt(0.6 * B04),
22+
Math.cbrt(0.6 * B03),
23+
Math.cbrt(0.6 * B02)]
24+
```
25+
26+
For Sentinel-2 L1C, the contrast was increased for better visualization:
27+
28+
```javascript
29+
return [Math.cbrt(0.6 * B04 - 0.035),
30+
Math.cbrt(0.6 * B03 - 0.035),
31+
Math.cbrt(0.6 * B02 - 0.035)]
32+
```
33+
34+
## Author of the script
35+
36+
Marko Repše
37+
38+
## Description of representative images
39+
40+
1) Beautiful Glacier Grey
41+
![Glacier Grey](fig1.jpg)
42+
43+
## Credits
44+
45+
[1] [Tonemapped Natural Color Script](https://custom-scripts.sentinel-hub.com/sentinel-2/tonemapped_natural_color/){:target="_blank"}
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//Highlight Optimized Natural Color Script
2+
//Author: Marko Repše
3+
4+
//For S2L1C:
5+
return [Math.cbrt(0.6*B04 - 0.035),
6+
Math.cbrt(0.6*B03 - 0.035),
7+
Math.cbrt(0.6*B02 - 0.035)]
8+
9+
10+
/*For S2L2A:
11+
return [Math.cbrt(0.6*B04 - 0.035),
12+
Math.cbrt(0.6*B03 - 0.035),
13+
Math.cbrt(0.6*B02 - 0.035)]
14+
/*

0 commit comments

Comments
 (0)