<!DOCTYPE html>
<html>
<head>
	<title>Sketchure</title>
</head>
<body>

<input id="files" type="file">
<br>
<canvas id="result"></canvas>
<img id="preview">

<script src="cleanup.js"></script>

<script>
document.getElementById("files").onchange = function (evt) {
	"use strict";
	var tgt = evt.target || window.event.srcElement;
	var files = tgt.files;

	// FileReader support
    var fr = new FileReader();
		fr.onload = function () {
		var canvas = document.createElement("canvas");
		var context = canvas.getContext("2d");

		var image = new Image();
		image.src = fr.result;

		var w = image.width;
		var h = image.height;

		canvas.width = w;
		canvas.height = h;

		context.drawImage(image, 0, 0);
		image = null;

		var data = context.getImageData(0, 0, w, h);

		cleanup.ImageData(data, 100, 10, true);

		var result = document.getElementById("result");
		result.width = w;
		result.height = h;
		result.getContext("2d").putImageData(data, 0, 0);
	};
	fr.readAsDataURL(files[0]);
};
</script>
</body>
</html>

Add JS code for online conversion.
Add JS code for online conversion.
