• In the end I dumped the 32 X 32 bmp into Uint32Arrays, here is the code:

    var image = require("fs").readFile("GIF/blue.bmp", "binary");
    image = image.substr(54,image.length);
    if (image.length==4096){
      var bytes = new Uint8Array(4096);
      for (var j=0;j<4096;j++){ 
        //bytes[j]=Math.round(image[j].charCodeA­t()*TONES/256);
        bytes[j]=image[j].charCodeAt();
        //console.log(image[j].charCodeAt());
      }
    }
    if (image.length==3072){
      var c = 0;
      var bytes = new Uint8Array(4096);
      for (var j=0;j<3072;j++){
        if ((c+1)%4==0){
          bytes[c]=128;
          c+=1;
        } else {
          //bytes[j]=Math.round(image[j].charCodeA­t()*TONES/256);
          bytes[c]=image[j].charCodeAt();
          
          //console.log(image[j].charCodeAt());
        }
        c+=1;
      }
    }
    
About

Avatar for user6837 @user6837 started