Map with a new tool

Touching up map images in GIMP.
GDAL
GIMP
Published

November 17, 2025

Touching up map images in GIMP

Inspired by articles by Robert Simmon:

I’ll make a true-colour image satellite image of Lochinver and Assynt, N.W. Highlands.

RGB satellite view of Lochinver area, NW Scotland. Sentinel-2a data. Shows faded appearance of image from GDAL and improved version after processing in GIMP.

Data

  • Downloaded data from Copernicus Browser (free registration) - Sentinel-2A with as small amount of cloud as possible (21st May 2025 and most days for a few weeks before that was virtually cloud-free in UK) for your area of interest.

Tools used

What did I learn?

  • Experience with the new GDAL application - much more consistent and not doing so much with a single tool, e.g. gdal_translate.
  • How to make alterations to an rgb satellite image in GIMP and then export again retaining GeoTIFF GIS data.

What could I do differently or want to find out?

  • Need to practice more with the colour correction tools. Wasn’t completely happy with this one.
  • Someone on Mastodon mentioned it works with elevation - I’d like to try that out.

Process (more detail about how I made the map)

Initial processing of data with GDAL

Want to create an RGB image, so need bands B02, B03 and B04 from Sentinel-2a.

Start by checking information of one of bands - particularly to check CRS.

gdal raster info rawdata\R10m\T30VUK_20250521T114401_B02_10m.jp2 --format=text

CRS = EPSG:32620

Files are all jp2 and I’d like to convert them to tiff and at the same time clip the area I want - to save space.

Use gdal raster clip with a bounding box of coordinates for the Lochinver area in the correct CRS in the order xmin, ymin, xmax, ymax. Need to do this for all three colour bands.

gdal raster clip --bbox=350000,6430000,390000,6460000 --bbox-crs=EPSG:32630 rawdata\R10m\T30VUK_20250521T114401_B02_10m.jp2 processed\Band02.tif

gdal raster clip --bbox=350000,6430000,390000,6460000 --bbox-crs=EPSG:32630 rawdata\R10m\T30VUK_20250521T114401_B03_10m.jp2 processed\Band03.tif

gdal raster clip --bbox=350000,6430000,390000,6460000 --bbox-crs=EPSG:32630 rawdata\R10m\T30VUK_20250521T114401_B04_10m.jp2 processed\Band04.tif

Now I should be able to merge the three bands:

  • Red = Band 4
  • Green = Band 3
  • Blue = Band 2
gdal raster stack processed\Band04.tif processed\Band03.tif processed\Band02.tif processed\rgb.tif --co PHOTOMETRIC=RGB --co COMPRESS=DEFLATE

Looks completely black in an image viewer, but can stretch values of each band to make the image visible.

First check min and max values of each band with gdal raster info --mm.

gdal raster info --mm processed\rgb.tif --format=text

Make a note of computed min/max for each band. Mine are:

  • Band 1 (red): 0, 8256
  • Band 2 (green): 0, 8164
  • Band 3 (blue): 0, 7712

All bands are 16-bit integers, so could have values up to 65,536. To display the image, we can stretch, or scale, each band equally to create a quick preview (note: Not for analysis!).

Input the highest maximum for the source data.

gdal raster scale --datatype UInt16 --src-min 0 --src-max 8256 processed\rgb.tif processed\rgb_stretched.tif --co COMPRESS=DEFLATE

Result should be visible in an image viewer, if not terribly clear.

Optimizing the image in GIMP

GIMP can open GeoTIFF, make alterations, then export again as a GeoTIFF which will open correctly in GIS.

Colour correction

All of this is in inexact science - it depends on your image and your perception of the colours in it.

https://medium.com/@robsimmon/making-sense-of-satellite-data-an-open-source-workflow-color-correction-with-gimp-7ddae0360fea

  • Tonal adjustment: Colors > Curves.... Check Value channel is selected. Click on line across middle and pull up and left to brighten image. Then move lower-left of curve to right. Darker shadows/highlights still bright. May need to pull centre of curve down a bit.
  • Black point colour adjustment: Still in curves, change Channel to Blue. Drag lower-left of line towards right. Aim for towards the point where histogram starts to rise. Repeat with green and red. Suggests moving blue more than green, more than red.
  • White point colour adjustment: May only need to move top-right of red channel slightly to left if have already scaled the image. Probably don’t need to do anything to green or blue.

Difficult! Not quite happy, but running out of time.

Saturation and sharpness

https://medium.com/@robsimmon/making-sense-of-satellite-data-part-5-saturation-sharpness-e21fac6272c7

  • Colors > Hue-Saturation... - best to be light-touch
  • Filters > Enhance > Sharpen (Unsharp mask)...:
    • Set Radius to a large number, e.g. 50.
    • Set Amount to somewhere in range of 0.10 to 0.30. Only want to sharpen very slightly!
Saving as GeoTIFF

GIMP can then export the result as a GeoTIFF which will keep the original metadata and open in the correct location back in QGIS.

  • Export as... and save as tif.
  • Tick the box Save GeoTiff data.
Back to top