• Welcome to SC4 Devotion Forum Archives.

Greyscale values help needed

Started by DanFraser, September 06, 2009, 03:54:38 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DanFraser

I'm just bored doing a little program that helps me design a map.

I've found the colour values in another thread a bit further down

RGB=0: 252m below sea level
RGB=50: 102m below sea level
RGB=84: sea level
RGB=100: 48m abv sea level
RGB=150: 198m abv sea level
RGB=200: 348m abv sea level
RGB=255: 513m abv sea level

I've come up with a simple formula to translate the values to metres and it's this:

Quote(Value * 3) - 256 + 4 = Metres

I can't figure out why the +4 is needed to eactly match those values but it seems to be a constant so it doesn't matter.

How have these values to metres been figured out previously?

I'd also like to find out how to define a slope.  Say I have a flat seabed at 20m below sea level, and a slope tile along the coast then a shoreline 20m above sea level.  What value would the slope be in the greyscale image?  0?  Null (in programming terms)?

GrindPepper

Do you mean -

((Value * 3) - 256) + 4 = Metres

or

(Value * 3) - (256 + 4) = Metres

Both bring different results each value. Your description of 4 as a constant seems to indicate it's the first formula you mean, and besides, if it were the second option it would be logical to just put it is as 260.

ksmith

Quote from: DanFraser on September 06, 2009, 03:54:38 AM
I'm just bored doing a little program that helps me design a map.

I've found the colour values in another thread a bit further down

RGB=0: 252m below sea level
RGB=50: 102m below sea level
RGB=84: sea level
RGB=100: 48m abv sea level
RGB=150: 198m abv sea level
RGB=200: 348m abv sea level
RGB=255: 513m abv sea level

I'd also like to find out how to define a slope.  Say I have a flat seabed at 20m below sea level, and a slope tile along the coast then a shoreline 20m above sea level.  What value would the slope be in the greyscale image?  0?  Null (in programming terms)?

To determine the value for any given elevation based upon your chart the equation is (Elevation+252)/3
Therefore the Elevation of -20 would give you a value of 77.3333 rounding this off to a whole number of 77
and the Elevation of 20 would give you a value of 90.6667 rounding this off to a whole number of 91

To answer your question of the slope in between these two Eleavtions it would be range in values from 78 to 90