Many of this things can be done using mojo and other monkey modules but it will be nice a good implementation.
This is a couple of things than could be useful.
GIMP Palette
Name: Borders
#
204 52 180
204 52 180
204 52 184
204 48 188
200 48 192
200 44 200
200 44 204
....;Init graphics
Graphics 800,600,32,2
;Loading a image
Original_Img = LoadImage ("textimage.png")
;take the width and height of the image
img_Width = ImageWidth(image)
img_Height = ImageHeight(image)
;Create a empty image with the same size
Result_Img = CreateImage (img_Width,img_Heigh)
;Set the buffer to read pixels inside Original_Img
SetBuffer Original_Img
;Read de color of every pixel inside the Original Image
;and write it back with the new color inside the Result Image
For x=0 To img_Width
For y=0 To img_Height
GetColor (x,y) ;Read de color of the pixel
Local R = ColorRed ;Store the Red value
Local G = ColorGreen ;Store the Green value
Local B = ColorBlue ;Store the Blue value
Local index = SearchIndex ("Palete.gpl",R,G,B) ; Store the index of the values RGB
Local rgb = SearchColor ("Palete2.pgl",index) ;Search for color values of the index in the other palette
WritePixel(x,y,rgb,Result_Img)
Next
Next
;Now he have a copy of the Original Image with a new color palette
;**************************************************************************************************
Function SearchIndex(file$,cR%,cG%,cB%)
Local ind%=0 ;value to count lines
filein = ReadFile (file$) ;Open the file to read
While Not Eof(filein)
If ReadLine (filein) = cR + " " + cG + " " + cB Then
Return ind% ;We have the index
EndIf
ind% ++
Wend
CloseFile (filein) ;Close the file
End
Function SearchColor(file$,ind%)
Local rgb
filein = ReadFile(file$) ;Open the file to read
Local DataColor ="" ;A value to store the string located in the index
For n:=0 To ind%
DataColor = ReadLine(filein) ;A quick jump to the index line
n++
Next
;Now we have Datacolor with the 3 values R G B we need to tokenizer it to separate the values
;and here in Blitz3D the write pixels work in ARGB format stored in hexadecimal
;
;Example
; ARGB = FF3AC252
; Alpha FF = 255
; Red 3A = 58
; Green C2 = 194
; Blue 52 = 82
rbg = DataToARGB(DataColor)
End
Function DataToARGB(datacol)
;Things like tokenizer to separate the String to 3 values
;and convert the single values in a new one with a 4th value for the alpha
;and last return the values in a Hexadecimal format
End
JASC-PAL
0100
256
0 0 0
77 66 33
71 77 33
55 77 33
39 77 33
33 77 44
33 77 60
....
...
info face=#44 Font size=24 bold=0 italic=0 charset="" unicode=1 stretchH=100 smooth=0 aa=1 padding=0,0,0,0 spacing=1,1
common lineHeight=30 base=24 scaleW=256 scaleH=256 pages=1 packed=0
page id=0 file=44font_s24_00.png
chars count=218
char id=32 x=106 y=0 width=0 height=0 xoffset=0 yoffset=24 xadvance=7 page=0 chnl=0info face=#44 Font size=24 bold=0 italic=0 charset="" unicode=1 stretchH=100 smooth=0 aa=1 padding=0,0,0,0 spacing=1,1
common lineHeight=30 base=24 scaleW=256 scaleH=256 pages=1 packed=0
page id=0 file="44font_s24_00.png"
chars count=218
char id=32 x=106 y=0 width=0 height=0 xoffset=0 yoffset=24 xadvance=7 page=0 chnl=0