Using: QGIS 3.24.0 Tisler, ImageMagick 7.2.0-29, both Windows 64 bit on Windows 10. The computer has 96GB of RAM and all the software is 64 bit builds, so I don't think it's a shortage of memory.

I have some ALOS 30m heightmap data in GEOTiff format that I am trying to get a softer hillshade of it to use as the background for a map.

When I load the original file (copied from the ALOS original ALPSMLC30_N032E010_DSM.tif), it will hillshade fine and display the hillshading if you select Raster->Analysis->Hillshade from the menu.

The range of values in the original comes out at 23-642 (see below)

Screenshot of the layers pane

In order to do this, I am resampling the file using Imagemagick to interpolate from 30m to a 3m pseudo-scale.

magick convert Tataouine30m.tif -filter Spline -resize 1000% Tataouine3m.tif
magick Tataouine3m.tif -crop 7200x7200+12000+0 Tataouine3m_cropped.tif

If I load the resulting image, I get this range of values and the hillshading no longer produces sensible results. Also, the values of the Band 1 (gray) range are now different.

Band1 range on transformed geotiff has changed.

Two things have happened. The coordinate system has been lost and the range of values in band1 has changed. Hillshading doesn't work properly, and if I export the layer as a TIFF and open it in Photoshop it is just a uniform black or dark grey. Frigging the levels doesn't do anything.

The question is twofold:

How can I resize and crop a geotiff (using ImageMagick or some other means) and retain the coordinates and height range so that I can generate a hillshade off it?

My google-fu is failing me. Am I barking up the wrong tree here?

1 Answer 1


You can clip rasters in QGIS: Clipping raster with vector boundaries using QGIS

You can resample rasters in QGIS: Resampling GeoTIFF images to same resolution using QGIS

non-GIS graphic tools may or may not know about spatial referencing so you can lose the coordinate system and resolution information. Recent versions of GIMP might maintain the spatial reference information in a GeoTIFF but I'd still do this work in QGIS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.