get("#388") -- rect functions get("#348") -- rgb functions get("#356") -- num2hex get("#380") -- imageHash get("#428") -- findContents problem = findContents() if problem then return problem end fw, fh = 8, 17 -- font width/height tw = math.floor((contents_x2-contents_x1)/fw+0.5) th = math.floor((contents_y2-contents_y1)/fh+0.5) print("Terminal size: "..tw.."*"..th) tbl = {} c, clast = 0x20, 0x7E for y = 0, th-1 do for x = 0, tw-1 do xx, yy = contents_x1+x*fw+1, contents_y1+y*fh cropped = {width=fw-1, height=fh-1, getInt = function(x, y) return img.getInt(xx+x, yy+y) end} hash = hashImage(cropped) print(c, xx, yy, hash) table.insert(tbl, '["'..hash..'"]=string.char('..c..')') c = c+1 if c > clast then goto raus end end end ::raus:: return "characterReference = {\n"..table.concat(tbl, ",\n").."}"