• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Image manipulation of GeoTiffs with Gimp

Messages
7
Country
us-california
I'm creating some photoreal scenery for New Mexico, getting the source imagery from EarthExplorer. I convert the GeoTiffs to the correct projection with FwTools. I can then resample it into BGL. Everything works fine.

But when I do some color correction using Gimp, the newly saved GeoTiff becomes unusable by resample. I have an old copy of PhotoShop that doesn't even read GeoTiffs, so I can't test with that.

After color correcting, I simply 'save as'. Is the GeoTiff info being discarded? I'm not really much of a graphics person - I can just do the minimum required.

Thanks!
 

rhumbaflappy

Administrator
Staff member
Resource contributor
Messages
5,156
Country
us-wisconsin
Gimp does not write geotiff tags, so you will lose the information when saving the file.

You can save the geotiff information, then restore it to a tiff after saving from Gimp with a tool:

GeoTiff Tools

Also, please work with a COPY of your original geotiff. :)

Dick
 
Last edited:
Messages
173
Country
unitedstates
Resample works with formats other than GeoTiffs. I start with GeoTiffs, then they become PNGs, only to end up as BMP files. Along the way I have generated a TFW file for the GeoTiff info, which coupled with a little spaghetti code program I wrote turns into an INF file already to be used for compiling.
 
Messages
3
Country
unitedkingdom
Hey! Very interesting discussion! Maybe you can help me with a related problem!?

This is the issue I'm having: After manipulating a georectified raster image in GIMP and using the tools listgeo and geotifcp to retain the geospatial information, ArcGIS only displays a black image.

Here's what I did:

I georectified a scanned copy of an old map in ArcGIS 10.3.1 and saved it as a geoTIFF; I used the graphic software program GIMP to manipulate the image; Since GIMP cannot handle geoTIFFs, I used the tool listgeo to save the geospatial information of the georectified map in a separate file before manipulating the map in GIMP; After photoshopping the map (image was not resized or cropped), I used the tool geotifcp to re-apply the geospatial information to the manipulated TIFF image (what seems strange though is that geotifcp creates a TIFF file with a size of only 47Kb whereas the photoshopped TIFF has a size of more than 100Mb...); When I now try to import the manipulated geoTIFF back into ArcGIS, only a completely black image is displayed.

Thanks for your thoughts on this issue!
 
Last edited:
Messages
981
Country
us-florida
When you use geotifcp to add the geo information back to your input tif your output geotiff must have a different file name from the input tif. There appears to be some sort of bug. Just change the name of your output file(however slightly) and you should have no problem.

Ed
 
Messages
6,827
Country
us-illinois
http://www.fsdeveloper.com/forum/threads/image-manipulation-of-geotiffs-with-gimp.20364/#post-134579

Gimp does not write geotiff tags, so you will lose the information when saving the file.

You can save the geotiff information, then restore it to a tiff after saving from Gimp with a tool:

GeoTiff Tools

Also, please work with a COPY of your original geotiff. :)

Dick

FYI
: Updated and working URL for "GeoTiff Tools" originally linked above by Dick:

https://onedrive.live.com/?id=F3950C5BBD2BCFA1!436&cid=F3950C5BBD2BCFA1 on Dicks new OneDrive


PS: If MaikS is unable to resolve the display anomaly, please post an attached or linked example tile of the aerial imagery before and after using geotifcp ...so that we can try to determine the nature of the problem, and suggest a workaround.


Hope this helps ! :)

GaryGB
 
Messages
6,827
Country
us-illinois
Here is the Metadata from Global Mapper for the *.TIF files in "Geotiff_for_GIMP.zip" linked by MaikS above:

FILENAME=gradteigtr_j15_1901_georectified.tif
DESCRIPTION=gradteigtr_j15_1901_georectified.tif
UPPER LEFT X=410828.802
UPPER LEFT Y=7402100.475
LOWER RIGHT X=470804.323
LOWER RIGHT Y=7351571.742
WEST LONGITUDE=12° 58' 38.9455" E
NORTH LATITUDE=66° 44' 09.4323" N
EAST LONGITUDE=14° 20' 58.2552" E
SOUTH LATITUDE=66° 16' 16.8818" N
UL CORNER LONGITUDE=12° 58' 38.9455" E
UL CORNER LATITUDE=66° 43' 27.7428" N
UR CORNER LONGITUDE=14° 20' 15.2835" E
UR CORNER LATITUDE=66° 44' 09.4323" N
LR CORNER LONGITUDE=14° 20' 58.2552" E
LR CORNER LATITUDE=66° 16' 57.6824" N
LL CORNER LONGITUDE=13° 00' 50.0527" E
LL CORNER LATITUDE=66° 16' 16.8818" N
PROJ_DESC=UTM Zone 33 / ETRS89 / meters
PROJ_DATUM=ETRS89
PROJ_UNITS=meters
EPSG_CODE=EPSG:3045
COVERED AREA=3030.5 sq km
LOAD TIME=0.03 s
NUM COLUMNS=6990
NUM ROWS=5889
NUM BANDS=2
PIXEL WIDTH=8.58 meters
PIXEL HEIGHT=8.58 meters
BIT DEPTH=16
SAMPLE TYPE=Unsigned 8-bit Integer
DPI=72
DOCUMENT_NAME=F:\Geotiff_for_GIMP\gradteigtr_j15_1901_georectified.tif
PHOTOMETRIC=Greyscale (Min is Black)
BIT_DEPTH=16
SAMPLE_FORMAT=Unknown Format (0)
ROWS_PER_STRIP=64
COMPRESSION=LZW
ORIENTATION=row 0 top, col 0 lhs
DPI=72
PIXEL_SCALE=( 8.58019, 8.58019, 0 )
TIEPOINTS=( 0.00, 0.00, 0.00 ) --> ( 410833.092, 7402096.185, 0.000 )
MODEL_TYPE=Undefined Model (Not a GeoTIFF File)
RASTER_TYPE=Pixel is Point

FILENAME=gradteigtr_j15_1901_georectified_gf.tif
DESCRIPTION=gradteigtr_j15_1901_georectified_gf.tif
UPPER LEFT X=410828.802
UPPER LEFT Y=7402100.480
LOWER RIGHT X=470804.323
LOWER RIGHT Y=7351571.747
WEST LONGITUDE=12° 58' 38.9455" E
NORTH LATITUDE=66° 44' 09.4324" N
EAST LONGITUDE=14° 20' 58.2552" E
SOUTH LATITUDE=66° 16' 16.8820" N
UL CORNER LONGITUDE=12° 58' 38.9455" E
UL CORNER LATITUDE=66° 43' 27.7429" N
UR CORNER LONGITUDE=14° 20' 15.2835" E
UR CORNER LATITUDE=66° 44' 09.4324" N
LR CORNER LONGITUDE=14° 20' 58.2552" E
LR CORNER LATITUDE=66° 16' 57.6826" N
LL CORNER LONGITUDE=13° 00' 50.0527" E
LL CORNER LATITUDE=66° 16' 16.8820" N
PROJ_DESC=UTM Zone 33 / ETRS89 / meters
PROJ_DATUM=ETRS89
PROJ_UNITS=meters
EPSG_CODE=EPSG:3045
COVERED AREA=3030.5 sq km
NUM COLUMNS=6990
NUM ROWS=5889
NUM BANDS=2
PIXEL WIDTH=8.58 meters
PIXEL HEIGHT=8.58 meters
BIT DEPTH=16
SAMPLE TYPE=Unsigned 8-bit Integer
DPI=72
DOCUMENT_NAME=F:\Geotiff_for_GIMP\gradteigtr_j15_1901_georectified.tif
GT_CITATION=PCS Name = ETRS_1989_UTM_Zone_33N
GEOG_CITATION=GCS Name = GCS_ETRS_1989|Datum = ETRS_1989|Ellipsoid = GRS_1980|Primem = Greenwich|
PHOTOMETRIC=Greyscale (Min is Black)
BIT_DEPTH=16
SAMPLE_FORMAT=Unknown Format (0)
ROWS_PER_STRIP=64
COMPRESSION=LZW
ORIENTATION=row 0 top, col 0 lhs
DPI=72
PIXEL_SCALE=( 8.58019, 8.58019, 1 )
TIEPOINTS=( 0.00, 0.00, 0.00 ) --> ( 410828.802, 7402100.480, 0.000 )
MODEL_TYPE=Projection Coordinate System
RASTER_TYPE=Pixel is Area

NOTE: gradteigtr_j15_1901_georectified_gf.tif:

*
Corel PhotoPaint crashes when opening

* Corel PaintShop Pro shows 1 empty image layer (Alpha channel ? :scratchch)

* (I have not yet tried opening in GIMP or PhotoShop)


I might personally get some free time available for further comment later today; but perhaps others here may also wish to offer their input at this point ? ;)

GaryGB
 
Last edited:
Messages
5,214
You have the metadata. So you can work in GIMP and change color etc., then make an inf file (like Arno said) using the metadata of Globalmapper and then resample.
Unless I misunderstood your problem?
 
Messages
3
Country
unitedkingdom
Thank you so much for all your input!
I THINK I'VE FOUND THE PROBLEM.
listgeo and geotifcp didn't work because I saved the original geoTIFFs in ArcGIS in a compressed format (LZW). Apparently, listgeo and geotifcp can't handle compressed images.
So always save geoTIFFs as UNcompressed files if you intend to use the listgeo and geotifcp tools!
 
Messages
6,827
Country
us-illinois
Thank you so much for all your input!
I THINK I'VE FOUND THE PROBLEM.
listgeo and geotifcp didn't work because I saved the original geoTIFFs in ArcGIS in a compressed format (LZW). Apparently, listgeo and geotifcp can't handle compressed images.
So always save geoTIFFs as UNcompressed files if you intend to use the listgeo and geotifcp tools!

Indeed; XnView throws a warning message when attempting to open gradteigtr_j15_1901_georectified_gf.tif:

"TIFF: Bad LZW codes !"


Also, be aware that FS SDK Resample takes much longer to process any TIFF imagery which has had LZW compression applied to it.:alert:


I'm also assuming you are aware that all GIS imagery must be submitted to FS SDK Resample in Geographic (Lat-Lon) / WGS84 projection ?


BTW
: If you are not yet aware of the following linked tutorial, you may wish to review it ...here:

http://www.flightsim.com/vbfs/showthread.php?250762-How-to-create-photoreal-scenery-for-FSX


Hope this helps ! :)

GaryGB
 
Last edited:
Messages
981
Country
us-florida
Thank you so much for all your input!
I THINK I'VE FOUND THE PROBLEM.
listgeo and geotifcp didn't work because I saved the original geoTIFFs in ArcGIS in a compressed format (LZW). Apparently, listgeo and geotifcp can't handle compressed images.
So always save geoTIFFs as UNcompressed files if you intend to use the listgeo and geotifcp tools!
Thanks for the tip.
 

ollyau

Resource contributor
Messages
1,023
Country
us-california
Messages
128
Country
italy
Gimp does not write geotiff tags, so you will lose the information when saving the file.

You can save the geotiff information, then restore it to a tiff after saving from Gimp with a tool:

GeoTiff Tools

Also, please work with a COPY of your original geotiff. :)
I have used

GeoTIFF_Tools_GUI_modern.zip

It uses the latest FWTools dlls. They are multiplying to increase the bloat, but they do handle LZW compression in the tif. It uses the same GUI... just the dlls are changed, so there is some backward compatibility.

When I use listgeo part of the program to dump geotiff data all I get is blank gtf/tfw file with 0 bytes opened in Notepad.
Always the same result. Any idea what might be wrong here?

Thanks!
 
Messages
6,827
Country
us-illinois
Hello:

Once again Dick's OneDrive public access is toggled "off".

< Dick, could you help us out here ? :oops: >


Otherwise, you may wish to consider instead using the work-flow that Holger Sandmann uses:

https://www.fsdeveloper.com/forum/threads/geotiffs-with-water-blend-alphas.19751/post-130225


Note also that ollyau's GeoTiff-To-Inf utility can read a GeoTIFF and write out a SDK Resample *.INF file to expedite Holger's work-flow:


GaryGB
 
Last edited:
Messages
128
Country
italy
Hi GaryGB,
Thanks for the attention. My problem is just to have a file in GeoTiFF format after editing it with GIMP (or Photoshop). I just can't understand why Giff_Tools_GUI doesn't work on my OS.

PS: Dick's correct OneDrive link is Dick GIS
 

rhumbaflappy

Administrator
Staff member
Resource contributor
Messages
5,156
Country
us-wisconsin
I don't believe the tool even works anymore. It doesn't for me. I use QGIS for just about anything GIS related. You can save a tiff with a worldfile (.tfw) and restore it by resaving as geotiff.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
31,295
Country
netherlands
FwTools is also very old, it's better to use the gdal command line tools that come with QGIS. They are much more recent.
 
Messages
6,827
Country
us-illinois
Hi GaryGB,
Thanks for the attention. My problem is just to have a file in GeoTiFF format after editing it with GIMP (or Photoshop).

While I personally find GeoTIFFs more convenient and preferable to use, for those who find the learning curve too steep when attempting to utilize QGIS or OSGEOW4, if one is careful to not re-size any graphic image file as to its "original" total pixel count in Rows / Columns, it may not need Geo-Referencing, provided identical xDim / yDim pixel dimensions and ulyMap / ulxMap NW pixel Geographic coordinate code sections and the "UseSourceDimensions = 0 flag with the N/S/W/E coordinates beneath it" ... are all included for each source image used in each layer / section of a multi-source *.INF file ...as Holger explains in the linked post above. :idea:

GaryGB
 
Last edited:
Top