• 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.

MSFS20 Color Matching aerial imagery in MSFS

rhumbaflappy

Administrator
Staff member
Resource contributor
Messages
6,210
Country
us-wisconsin
One of the more difficult aspects of bringing aerial imagery into MSFS is matching the default color. If, and when we have seasons, this will be even harder to accomplish. I recently went through the aerial imagery tutorial by Nool Aerosystems.
The toolkit is great, and it makes a tedious project semi-automated with good results. The tutorial uses ImageMagick to accomplish it's recoloring of aerial tiles, but I found that result to be less than optimal.

What I found that works is using Paint.net to color match a prepared base image. The same should be able to be done by Gimp or PhotoShop.

1) Get the reference image
2) color-correct the reference image to the sim
3) Color match the aerial Image to the reference image
4) Now process the re-colored aerial image into MSFS

Where to get a base image? I use Bing Maps aerial imagery. Just make a screenshot and save. You want the color and the color relationships. An MSFS screenshot of the default may also work, but then you are dealing with sun angle, seasonal sun angle, shadows, atmosphere, etc...


color.png

If I use this as a base color image, it won't look very good. When imagery is streamed to the sim, it has been enhanced. Luminence, contrast, saturation, hue, are all altered either on the source tiles, or by some combination of shaders, before the imagery is even streamed to the sim. To match this, we can use a paint program to alter our base image to match what the sim streams. There is some trial and error needed. I was able to get this for KLAF:


color01.png


More contrast, more color saturation, darker, less blue (more yellow).

Using Paint.net color matching, I was able to get this in the sim:

flawless.png


Nearly flawless. Can't find the seam between streamed and CGL unless you know where it is.
 
Last edited:
Here's a compilation using the bing tiles imagery, with no alteration from ImageMagick or any paint program:

FromBing.png


Notice how unsaturated it is, and too blue.

I'm guessing that the streaming tiles we get are pre-processed at the server. They are darkened and made bluer to account for the sim"s sunlight. The increased saturation may have to do with trying to make the aerial imagery seem more attractive (closer to real like), or may have to do with mitigating the atmospheric effects of water vapor, etc... Contrast might be sharpened for this as well.

I don't know if there is a standard algorithm or if some form of AI adjusts on a tile by tile basis.
 
Interesting stuff. I would assume that colour would vary wildly by location, so I tend to adjust visually, same as Prepar3d, but add a much higher gamma to prevent that lightening. Then load it and do any tweaking visually from there. I prefer my preferences even if there's a slight mis-match, so I mask to roads/fields etc so that a colour-change isn't that noticeable.
 
Here's a follow-up. I have a golf course and I wish to remove the sandtrap:

Bing tile:
030222201331331230.jpg


Processed tile to increase saturation a bit, made more yellow (less blue), clone-stamped from another grassy area, trimmed to the rough shape of the sand trap, and pixelated a bit:

030222201331331230.png


Before:
Untitled01.png


After (in a Community package):


Untitled.png


Sandtrap gone. This would help in areas too far from an airport to use the 'apron technique' of removing anomalies.
 
By the way, MSFS Toolkit can automatically download tiles from WMS services.
Instead of passing raster images with -imagery in the aerial tool, pass XML file that defines a WMS service:
Code:
msfs aerial -imagery someservice.xml -border myarea.kml -level 18 "C:\Dev\MyProject\Tiles"

Documentation:
https://gdal.org/drivers/raster/wms.html#xml-description-file

WMS service definition example:
https://github.com/OSGeo/gdal/blob/master/gdal/frmts/wms/frmt_wms_openstreetmap_tms.xml (OpenStreetMap tiles)
 
@rhumbaflappy, quick question. After I color-correct my image in Photoshop and resave as a TIF, MSFS Toolkit tells me that it does not support ungeoreferenced images. What is the trick to saving the edited file so that it is georeferenced?
 
I use Paint.Net: https://www.getpaint.net/

With this program, you can load a geotiff, alter it, and save it, and the saved result is a valid geotiff. (Don't resize the image, and make a copy of your geotiff before you load it in).

----------------------------------------------------------------------------------

Alternately, you can use gdal:

gdal_translate -co "TFW=YES" infileGeotiff myTif

The saved myTif.tif will have an myTif.tfw file that contains the georeferencing. The myTif is just a regular tif that can be painted ( Again, don't resize the image, and make a copy of your myTif.tif before you load it into a paint program).

After you paint and save the myTif, you can change it back to a geotiff:

gdal_translate -of GTiff myTif.tif newGeotiff.tif

and newGeotiff,tif is your re-georeferenced tiff.

-----------------------------------------------------------------------------------
 
Last edited:
@rhumbaflappy, quick question. After I color-correct my image in Photoshop and resave as a TIF, MSFS Toolkit tells me that it does not support ungeoreferenced images. What is the trick to saving the edited file so that it is georeferenced?
Here's another option: Before editing your GeoTiff, use GlobalMapper (Payware) or QGis (Freeware) to save your GeoTiff with a .map file. This will save all the positioning data to the .map as a secondary.

As long as you don't change the dimensions or rename the .tif, and keep the two files together (The updated .tif and original .map file), you can open the .map in one of those two programs, which will load the updated .tif. Then all you need to do is just save it as a GeoTiff again.
 
By the way, MSFS Toolkit can automatically download tiles from WMS services.
Instead of passing raster images with -imagery in the aerial tool, pass XML file that defines a WMS service:
Code:
msfs aerial -imagery someservice.xml -border myarea.kml -level 18 "C:\Dev\MyProject\Tiles"

Documentation:
https://gdal.org/drivers/raster/wms.html#xml-description-file

WMS service definition example:
https://github.com/OSGeo/gdal/blob/master/gdal/frmts/wms/frmt_wms_openstreetmap_tms.xml (OpenStreetMap tiles)
Does this avoid the need for color correction? I mean, does the toolkit apply the conversion to make it more saturated and more yellow etc?
 
Here's a follow-up. I have a golf course and I wish to remove the sandtrap:

Bing tile:
View attachment 74429

Processed tile to increase saturation a bit, made more yellow (less blue), clone-stamped from another grassy area, trimmed to the rough shape of the sand trap, and pixelated a bit:

View attachment 74430

Before:
View attachment 74431

After (in a Community package):


View attachment 74432

Sandtrap gone. This would help in areas too far from an airport to use the 'apron technique' of removing anomalies.
I have played with this before with some success just tweaking one of the 'color level' settings in Paint.net. Since some satellite data updates however it is no longer working. Have you settled on some general contrast, level, yellow/blue corrections in your experience or do you have to trial and error still each time?
 
Trial and error. :confused:

You could use color-matching with a screenshot or another source. The trouble with screenshots is they should be made at noon, and with an overcast sky... and hope the coloring is close. Sunlight and shadows can mess up a tile, as well as airport elements and objects. You'd still have to fine-tune it.
 
Back
Top