Here's the code I use to make the colours and load the map.

Public Class Form1

Dim land(0 To 127, 0 To 127) As Short

Dim tile As Short

Dim bMap As New Bitmap(520, 520)

Dim fHnd As Integer = FreeFile()

Dim x As Integer, y As Integer

Dim A As Long = &HFF, CR As Long, CG As Long, CB As Long, col As Long

Public Sub OpenMap(ByVal filename As String, ByVal imgMap As PictureBox)

FileOpen(fHnd, filename, OpenMode.Binary)

FileGet(fHnd, land, 1)

FileClose(fHnd)

For x = 1 To 128

For y = 1 To 128

tile = land(x - 1, y - 1)

If ((System.Math.Sqrt(System.Math.Sqrt(tile)) * 2) ^ 1.8).ToString.Contains(".") Then ' not a square number

col = tile \ 4

Else

col = ((System.Math.Sqrt(System.Math.Sqrt(tile)) * 2) ^ 1.8)

End If

CR = 48 - col

If CR < 0 Then CR = 0

CG = col

If CG < 32 Then CG = 32

If CG > 255 Then CG = 255

CB = 48 - col

If CB < 0 Then CB = 0

If CR = 0 And CG = 0 And CB = 0 Then CR = 1

If tile = 0 Then

bMap.SetPixel(x * 4 + 1, y * 4 + 1, Color.FromArgb(A, 0, 0, Int(Rnd() * 10) + 100))

bMap.SetPixel(x * 4 + 1, y * 4 + 2, Color.FromArgb(A, 0, 0, Int(Rnd() * 10) + 100))

bMap.SetPixel(x * 4 + 1, y * 4 + 3, Color.FromArgb(A, 0, 0, Int(Rnd() * 10) + 100))

bMap.SetPixel(x * 4 + 1, y * 4 + 4, Color.FromArgb(A, 0, 0, Int(Rnd() * 10) + 100))

bMap.SetPixel(x * 4 + 2, y * 4 + 1, Color.FromArgb(A, 0, 0, Int(Rnd() * 10) + 100))

bMap.SetPixel(x * 4 + 2, y * 4 + 2, Color.FromArgb(A, 0, 0, Int(Rnd() * 10) + 100))

bMap.SetPixel(x * 4 + 2, y * 4 + 3, Color.FromArgb(A, 0, 0, Int(Rnd() * 10) + 100))

bMap.SetPixel(x * 4 + 2, y * 4 + 4, Color.FromArgb(A, 0, 0, Int(Rnd() * 10) + 100))

bMap.SetPixel(x * 4 + 3, y * 4 + 1, Color.FromArgb(A, 0, 0, Int(Rnd() * 10) + 100))

bMap.SetPixel(x * 4 + 3, y * 4 + 2, Color.FromArgb(A, 0, 0, Int(Rnd() * 10) + 100))

bMap.SetPixel(x * 4 + 3, y * 4 + 3, Color.FromArgb(A, 0, 0, Int(Rnd() * 10) + 100))

bMap.SetPixel(x * 4 + 3, y * 4 + 4, Color.FromArgb(A, 0, 0, Int(Rnd() * 10) + 100))

bMap.SetPixel(x * 4 + 4, y * 4 + 1, Color.FromArgb(A, 0, 0, Int(Rnd() * 10) + 100))

bMap.SetPixel(x * 4 + 4, y * 4 + 2, Color.FromArgb(A, 0, 0, Int(Rnd() * 10) + 100))

bMap.SetPixel(x * 4 + 4, y * 4 + 3, Color.FromArgb(A, 0, 0, Int(Rnd() * 10) + 100))

bMap.SetPixel(x * 4 + 4, y * 4 + 4, Color.FromArgb(A, 0, 0, Int(Rnd() * 10) + 100))

Else

bMap.SetPixel(x * 4 + 1, y * 4 + 1, Color.FromArgb(A, CR, CG, CB))

bMap.SetPixel(x * 4 + 1, y * 4 + 2, Color.FromArgb(A, CR, CG, CB))

bMap.SetPixel(x * 4 + 1, y * 4 + 3, Color.FromArgb(A, CR, CG, CB))

bMap.SetPixel(x * 4 + 1, y * 4 + 4, Color.FromArgb(A, CR, CG, CB))

bMap.SetPixel(x * 4 + 2, y * 4 + 1, Color.FromArgb(A, CR, CG, CB))

bMap.SetPixel(x * 4 + 2, y * 4 + 2, Color.FromArgb(A, CR, CG, CB))

bMap.SetPixel(x * 4 + 2, y * 4 + 3, Color.FromArgb(A, CR, CG, CB))

bMap.SetPixel(x * 4 + 2, y * 4 + 4, Color.FromArgb(A, CR, CG, CB))

bMap.SetPixel(x * 4 + 3, y * 4 + 1, Color.FromArgb(A, CR, CG, CB))

bMap.SetPixel(x * 4 + 3, y * 4 + 2, Color.FromArgb(A, CR, CG, CB))

bMap.SetPixel(x * 4 + 3, y * 4 + 3, Color.FromArgb(A, CR, CG, CB))

bMap.SetPixel(x * 4 + 3, y * 4 + 4, Color.FromArgb(A, CR, CG, CB))

bMap.SetPixel(x * 4 + 4, y * 4 + 1, Color.FromArgb(A, CR, CG, CB))

bMap.SetPixel(x * 4 + 4, y * 4 + 2, Color.FromArgb(A, CR, CG, CB))

bMap.SetPixel(x * 4 + 4, y * 4 + 3, Color.FromArgb(A, CR, CG, CB))

bMap.SetPixel(x * 4 + 4, y * 4 + 4, Color.FromArgb(A, CR, CG, CB))

End If

Next y

Next x

imgMap.Image = bMap

End Sub