<commit_before>var PNG = require("../lib/png").PNG;

var newfile = new PNG({width:10,height:10});

for (var y = 0; y < png.height; y++) {
  for (var x = 0; x < png.width; x++) {
    var idx = (png.width * y + x) << 2;

    var col = x < (png.width >> 1) ^ y < (png.height >> 1) ? 0xe5 : 0xff;

    png.data[idx] = col;
    png.data[idx + 1] = col;
    png.data[idx + 2] = col;
    png.data[idx + 3] = 0xff;
  }
}

newfile.pack()
  .pipe(fs.createWriteStream(__dirname + '/newfile.png'))
  .on('finish', function() {
    console.log('bitmap:', this.data);
    console.log('end !');
  });<commit_msg>Fix newfile example. Fixes #35<commit_after>var PNG = require("../lib/png").PNG;
var fs = require("fs");

var newfile = new PNG({width:10,height:10});

for (var y = 0; y < newfile.height; y++) {
  for (var x = 0; x < newfile.width; x++) {
    var idx = (newfile.width * y + x) << 2;

    var col = x < (newfile.width >> 1) ^ y < (newfile.height >> 1) ? 0xe5 : 0xff;

    newfile.data[idx] = col;
    newfile.data[idx + 1] = col;
    newfile.data[idx + 2] = col;
    newfile.data[idx + 3] = 0xff;
  }
}

newfile.pack()
  .pipe(fs.createWriteStream(__dirname + '/newfile.png'))
  .on('finish', function() {
    console.log('Written!');
  });
{'fraction_non_alphanumeric': 0.21746160064672596, 'fraction_numerical': 0.0274858528698464, 'mean_word_length': 2.9053627760252367, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '614459', 'n_tokens_mistral': 535, 'n_tokens_neox': 493, 'n_words': 117}