Skip to content

Commit

Permalink
fixed couple of issues with jsimg again
Browse files Browse the repository at this point in the history
  • Loading branch information
Ponali committed Mar 16, 2024
1 parent 53b2556 commit c39c953
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion files/jsimg/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ function getOriginalImageData(dataog,data){
return dataog;
}
function changeImage(){
x.clearRect(0,0,256,256);
x.drawImage(currentImage,0,0,256,256);
let dataog=x.getImageData(0,0,256,256),data=getModifiedImageData(dataog.data);
if(q("#io").value=="1"){
for(di in data){data[di]=0xff&func(data[di],di%4,floor(di/4)%256,floor(floor(di/4)/256))};
} else {
for(di in data){data[di]=func(data[di][0],data[di][1],data[di][2],di%256,floor(di/256));};
for(di in data){data[di]=func(data[di][0],data[di][1],data[di][2],di%256,floor(di/256)).map((a)=>0xff&a);};
};
x.clearRect(0,0,256,256);
x.putImageData(getOriginalImageData(dataog,data),0,0);
Expand Down

0 comments on commit c39c953

Please sign in to comment.