From 7f4179510b888f576d3f610ae83bbcc121af5e16 Mon Sep 17 00:00:00 2001 From: Ponali Date: Sat, 16 Mar 2024 07:25:42 +0100 Subject: [PATCH] added JSImg --- files/jsimg/index.html | 22 +++++++++++++++++ files/jsimg/script.js | 55 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 files/jsimg/index.html create mode 100644 files/jsimg/script.js diff --git a/files/jsimg/index.html b/files/jsimg/index.html new file mode 100644 index 0000000..d8a7f8e --- /dev/null +++ b/files/jsimg/index.html @@ -0,0 +1,22 @@ + + + + +
+ + +
+ + + + + + \ No newline at end of file diff --git a/files/jsimg/script.js b/files/jsimg/script.js new file mode 100644 index 0000000..1fd4d44 --- /dev/null +++ b/files/jsimg/script.js @@ -0,0 +1,55 @@ +let hexEncode=((a)=>{return a.split("").map((b)=>b.charCodeAt().toString(16).padStart(2,"0")).join("")}),hexDecode=((a)=>{return a.match(/.{1,2}/g).map((a)=>String.fromCharCode(parseInt(a,16))).join("")}), +d=document,Q=(a)=>d.querySelectorAll(a),q=(a)=>Q(a)[0] +Object.getOwnPropertyNames(Math).forEach((a)=>{window[a]=Math[a]}) +let c=document.querySelector("canvas"),x=c.getContext("2d"),i=createPlainImage(); +c.width=c.height=256,imgurl="",func=(()=>{}); +function createPlainImage(){ + let img=document.createElement("img"); + img.crossOrigin="Anonymous"; + img.onload=changeImage; + return img; +} +function getModifiedImageData(data){ + if(q("#io").value=="1"){return data;} + let out=[]; + for(let i=0;i{i=createPlainImage();imgurl="";updateEL();}); \ No newline at end of file