I have looked through the forum extensively but found no answer. Apologies in advance if this has been addressed somewhere already...

I have >500 png image files (from a microscope) that I would like to display in their correct relative positions. Each image file has an associated xml file that contains: 1. the center XY position (in microns) 2. the XY size of the image (in microns) 3. The amount of rotation (if any, in degrees)

The images are in an arbitrary positive cartesian coordinate system.

I have looked at the Freehand Georeferencer and Georeference plugins, but they do not allow referencing based on the middle of the image plus image size (as far as I can tell).

Is it possible to use the information in the xml file to georeference the png files in QGIS?

  • Why are you using GIS for this? It doesn't sound like a geographic project.
    – csk
    Nov 6, 2019 at 19:36
  • 1
    @csk These are spatially related images with a pre-defined coordinate system. We use GIS for similar projects a lot, as does the microanalysis community - see here for an example: eos.org/science-updates/making-maps-on-a-micrometer-scale
    – user153156
    Nov 6, 2019 at 21:55
  • 1
    Fascinating topic. Thank you.
    – csk
    Nov 7, 2019 at 1:27
  • Are you talking about Raster image marker symbology, perhaps? It is one of core function since QGIS 3.6.
    – Kazuhito
    Nov 7, 2019 at 9:38

1 Answer 1


You have a coordinate for the centre-point of the images and also their extents, all in microns. Thus it appears that you have enough data to determine the coordinates for the corners of the images. You can use these to georeference the images using gdal_translate from a command line (you have gdal_translate, which comes with QGIS).

The command line would look something like this:

gdal_translate -a_ullr 1000 5000 2000 4000 input.tif output.tiff

where the 1000 and 5000 form the coordinate for the upper left-hand corner of the image and the 2000 and 4000 form the coordinate for the lower right-hand corner of the image.

The output will be a GeoTiff that will load into QGIS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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