I'm having a problem where the output images are on top of each other.
For Example:
First generated image is wearing a black hat.
Second generated image is generated with no hat but the black hat from image one is still showing.
I have tried : ctx.clearRect(0, 0, canvas.width, canvas.height); but have had no luck as I'm not sure where it has to go.
I have been following the tutorial on youtube Code generative art for NFT in node.js .
Thank you.