);
var height = canvas.offsetHeight;
var pixelScale = Math.floor((height-(3*2)) /32);
var mouseDown = 0;
var selectedColor = "rgb(255,0,0)";
var selectedAlpha = 1;
var source = ""
var isProcessing = false;

var max_x = 32
var max_y = 32

function main(){
	canvas.style.width = pixelScale*max_x +"px" ;
	canvas.style.height = pixelScale*max_y +"px";
	bg.style.width = canvas.style.width;
	bg.style.height = canvas.style.height;
	for (var i = 0; i<max_x; i++){
		for (var j = 0; j<max_y; j++){
			var pixel = docum