Submit your widget

Image erasable effect with jQuery

Created 6 years ago   Views 21728   downloads 2983    Author boblemarin
Image erasable effect with jQuery
View DemoDownload 252.8 KB
Share |

This is a jQuery plugin that makes an image erasable (with mouse or touch movements)

This plugin replaces the targeted image by an interactive canvas that can be erased using touch or mouse inputs. You can specify a callback for completion and set the brush size.

Please note that I don't claim that the completion detection process is ultimately accurate. In fact you should rather use a completeRatio around 0.8 if you want a near-complete erase process.

To transform an image or canvas into an erasable canvas, just use this syntax :


To specify a brush size, add some options (default value is 40) :

$('#yourImage').eraser( { size: 30 } );
// and you can also change the size later :
// $('#yourImage').eraser( 'size', 30 } );

You can reset the canvas (back to the original image) with this code :


Read more: