Skip to content

Commit f2799be

Browse files
authored
Merge pull request #321 from azlinszkysinergise/main
Edited the Sentinel-2 True Colour custom script to also include current EOB Default
2 parents 853af9d + 29cd131 commit f2799be

File tree

6 files changed

+51
-8
lines changed

6 files changed

+51
-8
lines changed

sentinel-2/true_color/README.md

+34-8
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,18 @@ grand_parent: Sentinel
55
layout: script
66
permalink: /sentinel-2/true_color/
77
nav_exclude: true
8+
scripts:
9+
- - Visualization
10+
- script.js
11+
- - EO Browser
12+
- eob.js
813
examples:
9-
- zoom: '10'
10-
lat: '42.01869'
11-
lng: '12.58484'
14+
- zoom: '12'
15+
lat: '34.23664'
16+
lng: '127.20074'
1217
datasetId: S2L2A
13-
fromTime: '2023-10-12T00:00:00.000Z'
14-
toTime: '2023-10-12T23:59:59.999Z'
18+
fromTime: '2024-05-16T00:00:00.000Z'
19+
toTime: '2024-05-16T23:59:59.999Z'
1520
platform:
1621
- CDSE
1722
- EOB
@@ -23,7 +28,18 @@ examples:
2328

2429
## General description
2530

26-
The true color product maps Sentinel-2 band values B04, B03, and B02 which roughly correspond to red, green, and blue part of the spectrum, respectively, to R, G, and B components.
31+
The true color product maps Sentinel-2 band values B04, B03, and B02 which roughly correspond to red, green, and blue part of the spectrum, respectively, to R, G, and B components of the image shown.
32+
33+
But what color is true color? Various additional processing steps can be applied to scale the image values in a range that is well perceived and pleasing to the eye [(Sovdat et al, 2019)]((https://www.sciencedirect.com/science/article/pii/S0034425719300422)).
34+
35+
- For the default script here, we apply simple gain correction, multiplying the pixel values of each image band with a single constant value. This is the `gain` parameter which can be adjusted in the script window.
36+
37+
- For [Copernicus Browser](https://browser.dataspace.copernicus.eu/), we chose to apply default a true color script which adds [Highlight Compression](https://docs.sentinel-hub.com/api/latest/evalscript/functions/#highlightcompressvisualizer) and also saturation and contrast adjustment. In this context, saturation is the brightness of colours in the image and contrast is the difference between the bright and dark areas.
38+
The current True Color algorithm for Copernicus Browser can be accessed as [Sentinel-2 L2A optimized True Color](https://custom-scripts.sentinel-hub.com/sentinel-2/l2a_optimized/) and is also compatible with EO Browser.
39+
40+
- The default True Color script in [EO Browser](https://apps.sentinel-hub.com/eo-browser/) is more simple, with Highlight Compression between specific `min` and `max` values. The `min` and `max` values are user-adjustable, and of course, this script also works in Copernicus Browser
41+
42+
The bands to use for True Color are
2743

2844
For Sentinel-2: **BO4, B03, B02**
2945

@@ -37,10 +53,20 @@ For [MODIS](https://custom-scripts.sentinel-hub.com/modis/true-color/): **B01, B
3753

3854
## Description of representative images
3955

40-
True color visualization of Rome, on 8.10.2017.
56+
True color visualization of islands in the Korea Strait
57+
- With basic True Color Product (this script)
58+
59+
![True color visualization of islands in the Korea Strait, on 16.05.2024.](fig/basic_true_color.jpg)
60+
61+
- With EO Browser default True Color
62+
63+
![True color visualization of islands in the Korea Strait, on 16.05.2024.](fig/eob_default_true_color.jpg)
4164

42-
![True color visualization of Rome, on 8.10.2017.](fig/fig1.png)
65+
- With Copernicus Browser default True Color [Sentinel-2 L2A optimized True Color](https://custom-scripts.sentinel-hub.com/sentinel-2/l2a_optimized/)
4366

67+
![True color visualization of islands in the Korea Strait, on 16.05.2024.](fig/cdse_default_true_color.jpg)
4468

4569
## References
70+
- Sovdat, Blaž, Miha Kadunc, Matej Batič, and Grega Milčinski. "Natural color representation of Sentinel-2 data." Remote sensing of environment 225 (2019): 392-402. [Full Text](https://www.sciencedirect.com/science/article/pii/S0034425719300422)
71+
4672
- Wikipedia, [True color](https://en.wikipedia.org/wiki/False_color#True_color). Accessed October 10th 2017.

sentinel-2/true_color/eob.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//VERSION=3
2+
let minVal = 0.0;
3+
let maxVal = 0.4;
4+
5+
let viz = new HighlightCompressVisualizer(minVal, maxVal);
6+
7+
function setup() {
8+
return {
9+
input: ["B04", "B03", "B02", "dataMask"],
10+
output: { bands: 4 }
11+
};
12+
}
13+
14+
function evaluatePixel(samples) {
15+
let val = [samples.B04, samples.B03, samples.B02, samples.dataMask];
16+
return viz.processList(val);
17+
}
294 KB
Loading
Loading
Loading

sentinel-2/true_color/fig/fig1.png

-2.7 MB
Binary file not shown.

0 commit comments

Comments
 (0)