Skip to content Skip to sidebar Skip to footer

How To Detect If Html5 Canvas Is Blank?

I have a doodle application that saves an html5 canvas to an image in s3. I want to avoid saving blank (totally transparent) pngs if the user accidentally clicks 'save' without ha

Solution 1:

Can you easily detect clicks/draws? If so, you could have an initial 'canvas empty' boolean that gets flipped the first time the user draws anything.

Unfortunately, this wouldn't help if the user draws something, then erases it, then saves.


Post a Comment for "How To Detect If Html5 Canvas Is Blank?"