See the Pen PRYGOJ by NombreNombre (@NombreNombre) on CodePen.
This code is used to load an Image as a background.
To Start you must start with creating the variable img.
Then you create the function setup, which you will create the canvas and add this command:
img = loadImage("imagen.png"); You always have to link the image, it's recommendable to put the image on the folder with the code
After this, you create the setup and you have to connect the background with the image, writing inside the () of background the name of the variable
And that is how you link an image using p5.js. For the code click on this link https://nombrenombreimagemap.neocities.org/faceothers/Faceimage/image.js