Replace colour of pixel in one layer with colour of pixel in another layer

Hi there,

I have two GeoTIFF files of land cover in a location. One file is at 10m resolution while the other is at 30m resolution. I would prefer to use the 10m resolution file, however it is less accurate than the 30m file. In particular, the 10m file renders some building shadows as "water", while the 30m file correctly classifies them as "urban".

What I would ideally like to do is set up a script or formula that checks every pixel in the 10m file against the same pixel location in the 30m file and replaces the colour if it's not the same. So my pseudo code would be something like this:

Var 10m_file
Var 30m_file
Pixel = (0,0)
If 10m_file Pixel(RGB) == (0,0,255) AND 30m_file Pixel(RGB) == (255,0,0) {
  10m_file Pixel(RGB) = (255,0,0)

Note that "urban" is red in the above code, and I have ommitted more appropriate iteration over all pixel co-ordinates in the file in a for loop, but you get the gist.

Is something like this possible in Global Mapper?
Sign In or Register to comment.