Canvas is not clearing, generative images are overlapping
See original GitHub issueI’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.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:12
Top Results From Across the Web
Node.js Canvas image overlapping issue / canvas is creating ...
I can create the .png files fine but the first image or the image before is not being cleared. index.js const fs =...
Read more >Code generative art UPDATE 2 - YouTube
In this update, we take a look at how to solve the overlapping layers issue as well as the unique ID problem that...
Read more >How to position images within a canvas while avoiding ...
Suppose that you can fit a new image to the canvas. Move the image to the left as far as possible. You either...
Read more >Creating Generative Patterns with The CSS Paint API
A little familiarity with generative art and some knowledge of the Paint API/HTML canvas will be handy but not essential.
Read more >An Evolutionary Approach to Generative Art - onlygenerated
Canvas Background. All images begin with a very basic gradient of randomly chosen colors. Most of the time, this gradient is covered by...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

for(let i = 1; i <= edition; i++){ ctx.clearRect(0, 0, canvas.width, canvas.height); for (const layer of layers) await drawLayer(layer, i); console.log("Creating edition " + i);
This works for me. 😁✌️
On Wed, 1 Dec 2021 at 8:51 AM, Marssurterre @.***> wrote:
It stopped doing this with your edits! Thanks again!