A
A
Andrew2015-08-17 21:40:41
css
Andrew, 2015-08-17 21:40:41

Animation on Canvas?

Hello! Need help with canvas animation.
There is the following animation codepen.io/juniorCh/pen/doEREw
Please tell me how to make it so that when drawing from a picture, when the picture has already, for example, changed the backround by 90% (drawn), it changes it completely (drawn completely)? The second question is how to start another animation after that?
I would be very grateful for any help)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vlad Harbarchuk, 2015-08-17
@SilvaGT

Damn, I read it about 7 times and didn't understand what you mean.
Do you want the picture itself to change after the sketch area > 90% or to change the sketch background itself?

A
Alexander Taratin, 2015-08-17
@Taraflex

https://developer.mozilla.org/en/docs/Web/API/ImageData
On releasing the mouse, iterate over all the pixels on the canvas and count the number of red pixels.
UPD
codepen.io/andreruffert/pen/pvqly

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question