JSFiddle - React, Tailwind, and code Playground

by Kriti

JavaScript

var img = new SimpleImage("chapel.png");

print(img);

//img.values() for image gives back all of its pixels

for(var pixel of img.values()){
    
var newG = 255 - pixel.getGreen();
    
pixel.setGreen(newG);

}

print(img);