Art someone draws is made in a pixel-art editor and loaded with useLoadTexture. This example is about the other case: pictures generated in code, for procedural variations, for placeholders, or for an agent that has no image editor. That is what to use instead of drawing on a <canvas>, which only exists in a browser.
Every picture in this scene is generated. createPixels is a picture in memory, plain bytes; fillGradient, drawLine, fillRect, mapPixels and blitPixels paint on it; and createPixelTexture turns it into a texture a sprite shows like any loaded image.
There are no image files and no <canvas>. The painting is plain JavaScript, so it runs the same in the browser, on the native runtime and in a test, and paints the same pixels in all three. The sky is cut into fourteen bands dithered where two meet, the palms come from a seed, and the car is stamped together from a body and the same wheel twice.
Press R to repaint the hills and the palms with another seed. They are painted over in place and updatePixelTexture sends the change: no new textures.