Exporting high quality satellite images 2b30bdfed1ef4daa815f42efe8fe0148


Most of the case studies in this repository focus on quantitatively analysing satellite data to obtain insights into Australia’s changing environment. However, satellite imagery also represents a powerful tool for visualisation. Images taken by satellites can help explain physical processes, highlight change over time, or provide valuable context to better understand the impacts of recent environmental events such as flooding or fire. Satellite data can also be processed to create images of the landscape based on invisible wavelengths of light (e.g. false colour images), allowing us to obtain richer insights into features and processes that would otherwise be invisible to the human eye.

Digital Earth Australia use case

Digital Earth Australia provides over three decades of satellite imagery across the entire continent of Australia. Satellite data from the NASA/USGS Landsat program allow us to produce fortnightly images of Australia’s diverse natural and artificial landscapes at any time since 1986. More recently, the Copernicus Sentinel-2 mission has provided even higher resolution imagery as frequently as every 5 days since 2015.


This notebook provides an interactive tool for selecting, loading, processing and exporting satellite imagery as a high quality image file. This can be used in combination with the interactive Digital Earth Australia Maps platform to identify an image of interest, then download it using this notebook for use in other applications.

The tool supports Sentinel-2 and Landsat data, creating True and False colour images, and applying pansharpening to increase the resolution of Landsat 7 and 8 imagery.

Getting started

To run this analysis, run all the cells in the notebook, starting with the “Load packages” cell.

Load packages

Import Python packages used for the analysis.

%matplotlib inline

import sys
sys.path.insert(1, '../Supplementary_data/')
from notebookapp_imageexport import select_region_app, export_image_app

/env/lib/python3.8/site-packages/geopandas/_compat.py:106: UserWarning: The Shapely GEOS version (3.8.0-CAPI-1.13.1 ) is incompatible with the GEOS version PyGEOS was compiled with (3.9.1-CAPI-1.14.2). Conversions between both will be slow.

Select imagery

Analysis parameters

The following cell sets important required parameters used to plot and select satellite imagery on the interactive map.

  • date: The exact date used to display imagery on the map (e.g. date='1988-01-01').

  • satellites: The satellite data to be shown on the map. Three options are currently supported:


Data from the Landsat 5, 7 and 8 satellites


Data from the Sentinel-2A and 2B satellites

“Sentinel-2 NRT”

Most recent ‘near real time’ data from Sentinel-2A and 2B. Use this to obtain imagery acquired in the past three months.

If running the notebook for the first time, keep the default settings below. This will demonstrate how the analysis works and provide meaningful results.

# Required image selection parameters
date = '2020-01-30'
satellites = 'Sentinel-2'

Select location on a map

Run the following cell to plot the interactive map that is used to select the area to load and export satellite imagery.

Select the Draw a rectangle or Draw a polygon tool on the left of the map, and draw a shape around the area you are interested in. When you are ready, press the green done button on the top right of the map.

To keep load times reasonable, select an area smaller than 10000 square kilometers in size (this limit can be overuled by supplying the size_limit parameter in the select_region_app function below).

selection = select_region_app(date=date,

Export image

The optional parameters below allow you to fine-tune the appearance of your output image.

  • style: The style used to produce the image. Two options are currently supported:

“True colour”

Creates a true colour image using the red, green and blue satellite bands

“False colour”

Creates a false colour image using short-wave infrared, infrared and green satellite bands.

  • pansharpen: Whether to apply pansharpening (using the Brovey Transform) to increase the resolution of Landsat 7 and 8 imagery from 30 m to 15 m pixels. This will only be applied if all the following are true: data comes from Landsat 7 or 8, style is set to “True colour”, and no custom resolution is provided (see below).

  • resolution: The spatial resolution to load data. By default, the tool will automatically set the best possible resolution depending on the satellites selected (i.e. 30 m for Landsat, 10 m for Sentinel-2). Increasing this (e.g. to resolution = (-100, 100)) can be useful for loading large spatial extents.

  • vmin, vmax: The minimum and maximum surface reflectance values used to clip the resulting imagery to enhance contrast.

  • percentile_stretch: A tuple of two percentiles (i.e. between 0.00 and 1.00) that can be used to clip the imagery to optimise the brightness and contrast of the image. If this parameter is used, vmin and vmax will have no effect.

  • power: Raises imagery by a power to reduce bright features and enhance dark features. This can add extra definition over areas with extremely bright features like snow, beaches or salt pans.

  • image_proc_funcs An optional list containing functions that will be applied to the output image. This can include image processing functions such as increasing contrast, unsharp masking, saturation etc. The function should take and return a numpy.ndarray with shape [y, x, bands].

  • standardise_name: Whether to export the image file with a machine-readable file name (e.g. sentinel-2b_2020-01-30_dampier-western-australia_true-colour-10-m-resolution.png)

If running the notebook for the first time, keep the default settings below. This will demonstrate how the analysis works and provide meaningful results.

# Optional image export parameters
style = "True colour"
pansharpen = True
resolution = None
vmin, vmax = (0, 2000)
percentile_stretch = None
power = None
image_proc_funcs = None
output_format = "jpg"
standardise_name = False

Once you are happy with the parameters above, run the cell below to load the satellite data and export it as an image:

# Load data and export image



  • Workers: 1
  • Cores: 2
  • Memory: 13.11 GB

Exporting image to Sentinel-2B - 2020-01-30 - Dampier Archipelago, Western Australia - True colour, 10 m resolution.jpg.
This may take several minutes to complete...
Finished exporting image.

Downloading exported image

The image export will be completed when Finished exporting image appears above, and a preview of your image is shown below the map.

The high resolution image file generated above will be saved to the same location you are running this notebook from (e.g. typically Real_world_examples). In JupyterLab, use the file browser to locate the image file with a name in the following format:

Landsat - 2021-03-31 - Canberra, Australian Capital Territory - True colour.png

If you are using the DEA Sandbox, you can download the image to your PC by right clicking on the image file and selecting Download.

Next steps

When you are done, return to the Analysis parameters section, modify some values and rerun the analysis. For example, you could try:

  • Change satellites to "Sentinel-2" or "Sentinel-2 NRT" to export a Sentinel-2 image instead of Landsat.

  • Modify style to "False colour" to export a false colour view of the landscape that highlights growing vegetation and water.

  • Specify a custom resolution, e.g. resolution = (-1000, 1000).

  • Experiment with the vmin, vmax, percentile_stretch and power parameters to alter the appearance of the resulting image.

Additional information

License: The code in this notebook is licensed under the Apache License, Version 2.0. Digital Earth Australia data is licensed under the Creative Commons by Attribution 4.0 license.

Contact: If you need assistance, please post a question on the Open Data Cube Slack channel or on the GIS Stack Exchange using the open-data-cube tag (you can view previously asked questions here). If you would like to report an issue with this notebook, you can file one on Github.

Last modified: September 2021

Compatible datacube version:

import datacube


Browse all available tags on the DEA User Guide’s Tags Index

Tags: NCI compatible, sandbox compatible, landsat 5, landsat 7, landsat 8, sentinel 2, pansharpening, real world, plotting, widgets, interactive, no_testing