pingy.js
function(factor) {
      factor = clamp(to_int(factor), 1);

      var width = this.getWidth() * factor;
      var height = this.getHeight() * factor;

      var buf = new buffer(width, height);

      for (var y = 0; y < height; y++) {
        for (var x = 0; x < width; x++) {

          var i = get_index(width, x, y);
          var rgba = this.getColor(to_int(x / factor), to_int(y / factor));

          buf[i + 0] = rgba.r;
          buf[i + 1] = rgba.g;
          buf[i + 2] = rgba.b;
          buf[i + 3] = rgba.a;
        }
      }

      this._png.width = width;
      this._png.height = height;
      this._png.data = buf;

      return this;
    }
function(factor) {
      factor = clamp(to_int(factor), 1);

      var width = this.getWidth() * factor;
      var height = this.getHeight() * factor;

      var buf = new buffer(width, height);

      for (var y = 0; y < height; y++) {
        for (var x = 0; x < width; x++) {

          var i = get_index(width, x, y);
          var rgba = this.getColor(to_int(x / factor), to_int(y / factor));

          buf[i + 0] = rgba.r;
          buf[i + 1] = rgba.g;
          buf[i + 2] = rgba.b;
          buf[i + 3] = rgba.a;
        }
      }

      this._png.width = width;
      this._png.height = height;
      this._png.data = buf;

      return this;
    }
Enlarge by some integer factor

@param {Number} factor
@return {Pingy} self