I have the image such as this:

enter image description here

everything would be fine, but I cannot really use the normal georeference method explained here:


because I can't see the boundaries at all. I tried to set up the georeference points manually, although even there I have to put them in the map and alternatively provide the coordinates manually. My situation is somewhat upside down, because I can't see the image borders, but I know roughly the coordinates of its corners and the middle point. The problem is, that I don't know how to find it with the Georeferencer plugin.

I found some hints, which say, that the process is possible with GDAL:

How to geo-reference a tif image knowing corner coordinates

Georeference image using center point and size?

but the problem is, that I don't know how to run the GDAL console and where to put these values in.

The links beneath:


How to edit the GDAL/OGR console call in QGIS 3.0?

weren't helpful enough for me.

I am asking then about the possibility to georeference the PNG raster image in the situation, where borders aren't visible (the image includes transparent white background, so any styling couldn't work) but the coordinates of the corners and the middle point are known. Alternatively, is there an opportunity to see the image bounds in the GDAL georeferencer plugin?


After typing in the OSGEO console

     gdal_translate -of GTiff -a_srs 'EPSG:<4326>' -a_ullr <-3> <52> <-2> <51> <C:\Users\k\Desktop\elrrachidia - fez\Viewshed\Heywhatsthat\BHX\cloakpN52W003.png> <C:\Users\k\Desktop\elrrachidia - fez\Viewshed\Heywhatsthat\BHX\cloakpN52W003.tif>

I am getting an error:

< was unexpected at this time

How I did wrong here?

  • 2
    You could create the pgw file, if you know the coordinate of the corner and the resolution!
    – katagena
    Commented Nov 1, 2021 at 11:11
  • 1
    Just create it in a text app, and change the extension! en.wikipedia.org/wiki/World_file
    – katagena
    Commented Nov 1, 2021 at 12:24
  • 1
    At the end, you have your image.png and image.pgw! The pgw contains only 6 lines with size in x, rotation y, rotation x, size y, x-coord (center pixel upperleft) and y-coord (center pixel upperleft). Then, just load your raster and it should go at the correct place!
    – katagena
    Commented Nov 1, 2021 at 15:40
  • 1
    I had my comment as a answer cause it's a bit long...
    – katagena
    Commented Nov 1, 2021 at 15:58
  • 1
    A georeferenced PNG has 2 files. The .png (the image itself) and a second file .pgw. The PGW has the same name as your PNG file, and contains only the information to project the corresponding PNG at the right place. So in your case, you just need to create this file in WORD for exemple, and change the extension.
    – katagena
    Commented Nov 1, 2021 at 17:40

2 Answers 2


Yes, just say that you work in meter, and the resolution of your png is 25 cm, and your png has no rotation. So your pgw file looks like that:







Save it as name_of_your_png.rtf and change the extension to pgw. So it means:

  • Line 1: resolution in x (25 cm)
  • Line 2: no rotation in y
  • Line 3: no rotation in x
  • Line 4: resolution in y (25 cm)
  • Line 5: coordinate in x for the center of the upper left pixel (change it for fitting your case)
  • Line 6: coordinate in y for the center of the upper left pixel (change it for fitting your case)

When you load your PNG, no need to have GDAL.

  • OK, It seems to work, although is there some way to put the coordinates the same as WGS 84? Your example coordinates 1153999.94999999953434 correspond to Latitude 10.3250N and 2539000.04999999813735 to Longitude 22.84924E. How to make it suitable i.e. with WGS84? I have an error: CRS not defined - defaulting to WGS84. Is there any way to set the CRS in the PGW file?
    – Geographos
    Commented Nov 3, 2021 at 16:42
  • 1
    from what I understand world files never have CRS stored in them, you need to define the CRS manually when loading it into a GIS, see this answer gis.stackexchange.com/a/349278/98784 (note it also suggests the option of using a .prj file but this hasn't worked for me).
    – she_weeds
    Commented Nov 4, 2021 at 22:56
  • Correct. Don’t need to set a CRS. Once the PNG loaded, you can give it the correct CRS.
    – katagena
    Commented Nov 5, 2021 at 11:04

You can use gdal_translate (https://gdal.org/programs/gdal_translate.html) with parameter -a_ullr to georeference your image. In the example below I'm georeferencing a PDF file:

gdal_translate --config GDAL_PDF_BANDS 4 --config GDAL_CACHEMAX 1024 -co NUM_THREADS=ALL_CPUS -co COMPRESS=DEFLATE -co ZLEVEL=9 -co PREDICTOR=2 -co TILED=YES -a_srs EPSG:31255 -a_ullr 9623.23 326346.38 9933.23 326090.63 file.pdf file.tif 
  • yes I think I know it. The problem is, that I have no knowledge of where to put these expressions in.
    – Geographos
    Commented Nov 1, 2021 at 11:25
  • You have to enter the command in the OSGeo4W Shell.
    – christoph
    Commented Nov 1, 2021 at 11:27
  • I am getting an error: < was unexpected at this time. See my question update
    – Geographos
    Commented Nov 1, 2021 at 15:19
  • If you remove all < and > it should work.
    – christoph
    Commented Nov 1, 2021 at 17:37
  • Now I have: ERROR 6: Unknown option name '-'
    – Geographos
    Commented Nov 8, 2021 at 15:28

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.