diff --git a/dist/perspectivets.min.js b/dist/perspectivets.min.js
index c40d675..5ab640e 100644
--- a/dist/perspectivets.min.js
+++ b/dist/perspectivets.min.js
@@ -1,7 +1,9 @@
-!function(t,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a():"function"==typeof define&&define.amd?define(a):(t="undefined"!=typeof globalThis?globalThis:t||self).Perspective=a()}(this,(function(){"use strict";
+!function(t,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o():"function"==typeof define&&define.amd?define(o):(t="undefined"!=typeof globalThis?globalThis:t||self).Perspective=o()}(this,(function(){"use strict";
/*!
- Copyright 2021 Adonmo https://www.adonmo.com/
- Copyright 2010 futomi http://www.html5.jp/
+ Copyright 2010 futomi
+ Copyright 2014 Fabien LOISON
+ Copyright 2021 Adonmo
+ Copyright 2021 Aarni Koskela
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,9 +16,5 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-
- This file was modified by Fabien LOISON
-
- This file was further modified by Adonmo https://www.adonmo.com/
- */return function(){function t(t,a){if(t&&t.strokeStyle&&a&&a.width&&a.height){var e=document.createElement("canvas");e.width=Math.round(a.width),e.height=Math.round(a.height);var o=e.getContext("2d");o.drawImage(a,0,0,e.width,e.height);var i=document.createElement("canvas");i.width=t.canvas.width,i.height=t.canvas.height;var h=i.getContext("2d");this.ctxd=t,this.cvso=e,this.ctxo=o,this.ctxt=h}}return t.prototype.draw=function(t){for(var a=t.topLeftX,e=t.topLeftY,o=t.topRightX,i=t.topRightY,h=t.bottomRightX,n=t.bottomRightY,s=t.bottomLeftX,r=t.bottomLeftY,c=[Math.sqrt(Math.pow(a-o,2)+Math.pow(e-i,2)),Math.sqrt(Math.pow(o-h,2)+Math.pow(i-n,2)),Math.sqrt(Math.pow(h-s,2)+Math.pow(n-r,2)),Math.sqrt(Math.pow(s-a,2)+Math.pow(r-e,2))],p=this.cvso.width,d=this.cvso.height,f=0,v=0,g=0,l=0;l<4;l++){var m=0;(m=l%2?c[l]/p:c[l]/d)>v&&(f=l,v=m),0==c[l]&&g++}if(!(g>1)){var w=this.ctxo,M=this.ctxt;if(M.clearRect(0,0,M.canvas.width,M.canvas.height),f%2==0){(Y=this.create_canvas_context(p,10)).globalCompositeOperation="copy";for(var u=Y.canvas,x=0;xv&&(u=w,v=C),0==y&&b++}if(!(b>1)){var M,R=5*a,x=this,L=x.originalCanvas,T=x.transformedContext,X=x.destinationContext,Y=T.canvas;if(T.clearRect(0,0,Y.width,Y.height),u%2==0)(M=t(c,R)).globalCompositeOperation="copy",e(L,M,T,!0,c,m,a,i,d,n,g,r,s,h,f);else(M=t(R,m)).globalCompositeOperation="copy",e(L,M,T,!1,c,m,a,i,r,n,h,d,s,g,f);X.save(),X.drawImage(Y,0,0),function(t,o){var e=o.bottomLeftX,a=o.bottomLeftY,i=o.bottomRightX,n=o.bottomRightY,r=o.topLeftX,h=o.topLeftY,s=o.topRightX,f=o.topRightY;t.beginPath(),t.moveTo(r,h),t.lineTo(s,f),t.lineTo(i,n),t.lineTo(e,a),t.closePath(),t.globalCompositeOperation="destination-in",t.fill(),t.globalCompositeOperation="source-over"}(X,o),X.restore()}},o}()}));
//# sourceMappingURL=perspectivets.min.js.map
diff --git a/dist/perspectivets.min.js.map b/dist/perspectivets.min.js.map
index 921c281..dcc6a46 100644
--- a/dist/perspectivets.min.js.map
+++ b/dist/perspectivets.min.js.map
@@ -1 +1 @@
-{"version":3,"file":"perspectivets.min.js","sources":["../src/index.ts"],"sourcesContent":["/*!\nCopyright 2021 Adonmo https://www.adonmo.com/\nCopyright 2010 futomi http://www.html5.jp/\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\nThis file was modified by Fabien LOISON \n\nThis file was further modified by Adonmo https://www.adonmo.com/\n*/\n\ninterface Quadrilateral {\n topLeftX: number;\n topLeftY: number;\n topRightX: number;\n topRightY: number;\n bottomRightX: number;\n bottomRightY: number;\n bottomLeftX: number;\n bottomLeftY: number;\n}\n\nexport default class Perspective {\n // Context for destination (output will go here)\n private ctxd: CanvasRenderingContext2D;\n\n // Canvas for original image\n private cvso: HTMLCanvasElement;\n\n // Context for original image\n private ctxo: CanvasRenderingContext2D;\n\n // Context for transformed image\n private ctxt: CanvasRenderingContext2D;\n\n constructor(ctxd: CanvasRenderingContext2D, image: HTMLImageElement) {\n // check the arguments\n if (!ctxd || !ctxd.strokeStyle) {\n return;\n }\n if (!image || !image.width || !image.height) {\n return;\n }\n // prepare a