Ok, by making classes, and put them in instead of continual spans, you can 'compress' the file down quite a bit.
Also, you could get more speed out of using MemBlocks rather than the Point command.
Here's what I came up with based on your code.
This makes a Memblock, then makes a palette of colours, then assignes each to a class. The classes are then put into spans as needed.
This way, you save space, and also allow the browser to render the file MUCH quicker.
It's slower than your code as it needs to do palette checks ( and I provide some feedback to the user ), but it's bareable
Set Window On
Set Display Mode 640,480,32
Sync Off
color as dword
lastcolor As DWord
colorPos As Integer
lStr As String = ""
`in the generated file, string$ is the string that is repeated
string$ = "FIREFOX"
place# = 1
Text 0,0,"Loading Image..."
FastSync : FastSync
`the 'ff.bmp' image is what the generated file is based on
load image "ff.bmp",1, 1
Text 0,15,"Image Loaded"
Text 0,35,"Making Memblock / Getting Variables..."
FastSync : FastSync
Make MemBlock From Image 1, 1
wid As DWord
hei As DWord
dep As DWord
new As Boolean = 0
Global totColours As DWord = 0
wid = MemBlock DWord(1, 0)
hei = MemBlock DWord(1, 4)
dep = MemBlock DWord(1, 8) >> 3
Text 0,50,"Complete"
Text 0,70,"Creating Palette..."
FastSync : FastSync
`Fill in the colour pallette
Dim colours(0) As DWord
for imgline = 0 to hei - 1
for imgcoloum = 0 to wid - 1
new = 1
color = MemBlock DWord(1, 12 + (((wid * imgline) + imgcoloum) * dep))
For i = 0 To totColours
If colours(i) = color
new = 0
i = totColours
EndIf
Next i
If new = 1
colours(totColours) = color
Array Insert At Bottom colours(0)
Inc totColours
new = 0
EndIf
next imgcoloum
next imgline
Text 0,85,"Palette Created"
Text 0,105,"Writing out Palette..."
FastSync : FastSync
`'ff.html' is the name of the generated file - an HTML file
If File Exist("ff.html") Then Delete File "ff.html"
open to write 1,"ff.html"
write string 1,"<html><style type=" + chr$(34) + "text/css" + chr$(34) + ">body {font-size: 5px; letter-spacing: 1px; background-color: rgb(0,0,0);}"
For i = 0 To totColours - 1
Write String 1, ".n" + Str$(i) + "{color: #" + Right$(Hex$(colours(i)), 6) + ";} "
` Write String 1, ".n" + Str$(i) + "{color: rgb(" + str$(rgbr(colours(i))) + "," + str$(rgbg(colours(i))) + "," + str$(rgbb(colours(i))) + ");}"
Next i
Write String 1, "</style><body>"
Text 0,120,"Palette Written"
FastSync : FastSync
Wait 1000
time As Integer = Timer()
sec As Integer = 10
While ScanCode() = 0
Cls
If Timer() - time >= 1000 Then dec sec : time = Timer()
If sec = 0 Then Exit
Text 0,30,"Minimizing window in " + Str$(sec) + ", Will re-apear when file fully written"
FastSync
EndWhile
Minimize Window
`Get the first colour
lastColor = MemBlock DWord(1, 12)
colorPos = _find_pos(lastColor)
write string 1,"<span class='n" + Str$(colorPos) + "'>" + mid$(string$,place#)
inc place#
for imgline = 0 to hei - 1
for imgcoloum = 0 to wid - 1
lStr = ""
color = MemBlock DWord(1, 12 + (((wid * imgline) + imgcoloum) * dep))
if color <> lastColor
colorPos = _find_pos(color)
lStr = lStr + "</span><span class='n" + Str$(colorPos) + "'>"
lastColor = color
`write string 1,"</span><span class='n" + Str$(colorPos) + "'>"
EndIf
lStr = lStr + mid$(string$,place#)
`Write String 1, mid$(string$,place#)
if place# > len(string$)-1
place# = 1
else
place# = place# + 1
endif
write string 1,lStr
next imgcoloum
write string 1,"<br>"
next imgline
write string 1,"</span></html></body>"
close file 1
Restore Window
Cls
Text 0,0,"HTML Created"
Text 0,20,"Press Any Key to Exit..."
FastSync : FastSync
While ScanCode() = 0
EndWhile
End
Function _find_pos(col As DWord)
Local result As Integer
For i = 0 To totColours
If col = colours(i)
result = i
Exit
EndIf
Next i
EndFunction result
Enjoy
Attatched is an example output file.
Jess.
[EDIT]
Also, if you restricted it to a 256 colour palette, then you'd get alot more compression out, with hardly any quality loss ( since the quality is barely anything anyway as it's all just coloured text

).
Oh, and you'll notice that the example doesn't render right in IE, I beleive this is because it can't handle the sheer number of classes ( colours ) that the image outputted, so again, a 256 palette would benefit here.
[/EDIT]