I have a binary image (e.g., .png) with background transparency. Let\'s say it looks like a blob with an irregular, but solid shape (no holes and it\'s all in one piece).
This is pure JS solution without depending on any 3rd party library.
function getOutline(ctx,pointX,pointY,w,h){
var imageData = ctx.getImageData(pointX, pointY, w, h);
var data = imageData.data;
var outline=[];
for(var x=0;x