Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Landsat 8 Pansharpened True Color

let minVal = 0.0;
let maxVal = 0.4;

let viz = new DefaultVisualizer(minVal, maxVal);

function evaluatePixel(samples) {
    let sudoPanW = (samples.B04 + samples.B03 + samples.B02 * 0.4) / 2.4;
    let ratioW = samples.B08 / sudoPanW;
    let val = [samples.B04 * ratioW, samples.B03 * ratioW, samples.B02 * ratioW];
    val = viz.processList(val);
    return val;

function setup() {
  return {
    input: [{
      bands: [
    output: {
      bands: 4

Evaluate and visualize


The true color product maps Landsat 8 band values B04, B03, and B02, which roughly correspond to red, green, and blue part of the electromagnetic spectrum, respectively, to R, G, and B components. The RGB bands with spectral resolution of 30 meters were pansharpened using the PAN band with spectral resolution of 15 meters. The result is a true color image with the resolution of 15 meters. The script can only be used with Landsat 8 Level 1, as Level 2 collection does not have a panchromatic band.

Description of representative images

Pansharpened true color image of Rome. Acquired on 2020-07-30, processed by Sentinel Hub.