Convertor from BMP to TXT written in TCL\TK language (freeware and can be found here: tcl.tk). First argument input BMP file second argument output TXT file.
#!/bin/sh
# The next line restarts using wish8.3 \
exec wish8.3 $0 ${1+"$@"}
package require Img
proc Convert {inpFile outFile} {
set filename $inpFile
set outfile $outFile
if {[string compare $filename {}]} {
set imagename [list $filename]
image create photo $imagename -file $filename
set ff [open $outfile "a"]
puts $ff "[image height $imagename] [image width $imagename]"
for {set i 0} {$i < [image height $imagename]} {incr i 1} {
set s ""
for {set j 0} {$j < [image width $imagename]} {incr j 1} {
set a [$imagename get $j $i]
if {$a == "255 255 255"} {
set a "."
} else {
set a "X"
}
set s "$s$a"
}
puts $ff $s
}
close $ff
}
}
Convert [lindex $argv 0] [lindex $argv 1]