it says it rescales to a size smaller than the canvas (so how is it fully obscuring to begin with)
Not sure what you mean by that. The image is simply covered by a tilemap filled with black tiles.
Then the tiles are erased on the tilemap at random intervals and in blocks of random size.
For example, first r=30, so the first 30 tiles are removed. Then r=7, so tiles form 31 to 37 are removed. And so on.
By the way, this example has nothing to do with scripting. You should've posted it in "How do I" subforum.