I have an image in PNG format and bounding box coordinates (upper left, lower right). How do I georeference it using command-line interface tools such as GDAL (or Python if it is not possible)?

In the end, I want to open the PNG image in QGIS but NOT use QGIS to georeference it (because I need to create an automation script).

for instance, the image name is image.png and the bounding box is 53.1111876266,11.7303748998,55.5611387985,13.1036943879. What should I type in my terminal?

  • Possibly gdal_translate -co "WORLDFILE=YES" image.png output.png you might also need to use -a_ullr <ulx> <uly> <lrx> <lry>
    – nmtoken
    Apr 19 at 10:48
  • @nmtoken thanks this gives enough clue!
    – sutan
    Apr 19 at 11:27

1 Answer 1


gdal_translate is the tool. the command below will take the image.png, assign/georeference based on the bounding box (upper left, lower right) coordinates, and create an .aux.xml which containes the georeferencing location. Use the -a_ullr attributes. Further, read the documentation.

C:/> gdal_translate image.png output_georeferenced.png -a_ullr 53.1111876266 11.7303748998 55.5611387985 13.1036943879 -a_srs EPSG:4326

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.