MV Is it possible to Paint with Pixels using JavaScript?

I specifically ask if it is possible to create an eraser using a single particle. Initially, I used multiple picture-based masks of the same rock layer to represent holes punctured by the drill. However, I discovered that this could potentially cause lag. Here is a video of the results so far.

Cleaning Drill Effect Video

And for those who are curious about the code: I am currently using the TouchInput function's coordinates to have the drill navigate along the rock.
You can use the clearRect method to clear rectangular areas of an existing Bitmap, e.g.
Spoiler: Quick example
JavaScript:
(function(alias) {
'use strict';
  var sc = SceneManager._scene;  // shortcut

  // Runs when source image is loaded
  var myOnLoad = function(img) {
    var w = img.width, h = img.height;
    var sp = sc._mySprite = new Sprite(new Bitmap(w, h));
    sp.bitmap.blt(img, 0, 0, w, h, 0, 0);   // blit onto fresh canvas
    sp.move(100, 100);
    sc._spriteset.addChild(sc._mySprite);
  };

  // Eraser function, Sprite context
  var myEraser = function(x, y) {
    var size = 10;  // eraser width/height
    this.bitmap.clearRect(x - this.x, y - this.y, size, size);
  };

  // Call eraser on mouse/touch movement (press+move)
  TouchInput._onMove = function(x, y) {
    alias.apply(this, arguments);
    var sp = sc._mySprite;
    if (sp) myEraser.apply(sp, arguments);
  };

  // Request image, wait for load
  ImageManager.loadFace('Actor1').addLoadListener(myOnLoad);
})(TouchInput._onMove);
I've blitted the original image onto a new Bitmap here rather than just loading it directly, because otherwise I think the cached image would be altered (probably undesirable).

Here I've handled input by hooking into the methods used by the core scripts, but you could set up your own DOM event handlers to do this instead if you prefer~

Also, note that the game only refreshes once per frame. If you want smoother interpolation for erasing lines etc then you'd need to program that in, e.g. remember previous position & loop over coordinates between there and current position. You'd also want to clear that "previous position" if the touch input is released, e.g. by aliasing TouchInput._onRelease.
This is where I plan to use it:

JavaScript:
Spriteset_Cleaning.prototype.punctureHoles = function(alias){
    'use strict';
    var sc = SceneManager._scene;  // shortcut

    // Runs when source image is loaded
    var myOnLoad = function(img) {
    var w = img.width, h = img.height;
    var sp = sc._sprite = new Sprite(new Bitmap(w, h));
    sp.bitmap.blt(img, 0, 0, w, h, 0, 0);   // blit onto fresh canvas
    sp.move(100, 100);
    sc._spriteset.addChild(sc._sprite);
    };
   

    // Eraser function, Sprite context
    var Eraser = function(x, y) {
    var size = 16;  // eraser width/height
    this.bitmap.clearRect(x - this.x, y - this.y, size, size);
    };

    // Call eraser on mouse/touch movement (press+move)
    TouchInput._onMove = function(x, y) {
    alias.apply(this, arguments);
    var sp = sc._sprite;     //this is where the error is
    if (sp)    Eraser.apply(sp, arguments);
    };

    TouchInput._onRelease = function(lastX, lastY) {
    alias.apply(this, arguments);
    var touchX = TouchInput._x
    var touchY = TouchInput._y;
    lastX = touchX;
    lastY = touchY;
    }
   
    // Request image, wait for load
    ImageManager.loadRockL2(this.rockL2Name).addLoadListener(myOnLoad);
}(TouchInput._onMove);

  };

However, it is telling me that it cannot read property '_sprite' of null. Is there a way I can fix this?
Never mind that, how would you use the new bitmap created as a mask? For I did edit the code you offered as an example to fit mine.

Below is what I have currently for the entire code. Plus the assets I'm using. CleaningBG.pngd_2H.pngf_2H.pngfr_2H_2.pngfr_2H_1.pngfr_2H.png
I'm not very knowledgable about using PIXI masks, but I notice you've started a new thread so I'll link that:

Original thread: https://forums.rpgmakerweb.com/threads/is-it-possible-to-paint-with-pixels-using-javascript.133641/