So I was playing around a little and made a tool that takes my .bmp picture and converts it into a map that is useable by Planeshift. Here's some examples:
You can download the file
here. It looks like this:
First, load a .bmp image. "Canvas Boundary" gives the image a frame, "Scale" scales your image and "Brush Tip" determines which character is used to draw your image. The first image was done using "." with scale 2, the second "*" with scale 3. You'll need to experiment around.
Oh, and the colour white is set to transparent, meaning whatever portion of your image is blank white will be ignored by the converter. Keep in mind that there is a character limit of ~200 painted pixels per map, set by the game (Talad should totally increase that so we can import better drawings).
If you want to do a black and white painting, you're in luck, because that is easier: The best size is around 200x200 pixels, paint whatever you want in black, leave the rest white. Load the image, simply check the box "Charcoal" and hit convert. Scale has no effect in this setting.
For those who feel like complaining that this doesn't work on their operating system/whatever, here's the source code. I have no idea of coding and whatever you might need to get this working on your machine.
Imports System
Imports System.IO
Imports System.Text
Public Class Form1
Dim img As Bitmap
Function I2H(int As Integer) As String
Dim str As String
str = Hex(int)
If Len(str) = 1 Then
str = "0" + str
End If
Return str
End Function
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.Text = "BMP to XML by Donari"
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
img = Image.FromFile(OpenFileDialog1.FileName)
PictureBox1.Image = img
End If
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim x As Integer
Dim y As Integer
Dim cx As Integer
Dim cy As Integer
Dim out As String
Dim pt As String
Dim col As Color
Dim white As Integer
Dim scale As Integer
scale = CInt(TextBox1.Text)
white = Color.White.ToArgb()
y = img.Height
x = img.Width
cx = CInt(TextBox3.Text)
cy = CInt(TextBox2.Text)
If SaveFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
out = SaveFileDialog1.FileName
End If
Dim fs As FileStream = File.Create(out)
Dim info As Byte()
If Not CheckBox1.Checked Then
info = New UTF8Encoding(True).GetBytes("<pages><page l=""236"" t=""161"" w=""" + CStr(x * scale + 2 * cx) + """ h=""" + CStr(scale * y + 2 * cy) + """>")
fs.Write(info, 0, info.Length)
For i = 1 To x - 1
For j = 1 To y - 1
col = img.GetPixel(i, j)
If col.ToArgb() <> white Then
pt = "<tx x=""" + CStr(i * scale + cx) + """ y=""" + CStr(j * scale + cy) + """t=""" + TextBox4.Text + """ col=""" + I2H(col.R) + I2H(col.G) + I2H(col.B) + """/>"
info = New UTF8Encoding(True).GetBytes(pt)
fs.Write(info, 0, info.Length)
End If
Next
Next
Else
info = New UTF8Encoding(True).GetBytes("<pages><page l=""236"" t=""161"" w=""" + CStr(x * 4 + 2 * cx) + """ h=""" + CStr(3 * y + 2 * cy) + """>")
fs.Write(info, 0, info.Length)
For j = 1 To y - 1
pt = "<tx x=""" + CStr(1 + cx) + """ y=""" + CStr(j * 3 + cy) + """t="""
For i = 1 To x - 1
col = img.GetPixel(i, j)
If col.ToArgb() <> white Then
pt = pt + "''"
Else
pt = pt + " "
End If
Next
pt = pt + """ col=""0""/>"
info = New UTF8Encoding(True).GetBytes(pt)
fs.Write(info, 0, info.Length)
Next
End If
info = New UTF8Encoding(True).GetBytes("</page></pages>")
fs.Write(info, 0, info.Length)
fs.Close()
End Sub
End Class