ETS - 1462100212 - Muhammad Dhafi
ETS - 1462100212 - Muhammad Dhafi
Grafika Komputer
Link P5JS :
https://editor.p5js.org/muhammaddhafi7/sketches/vR4d6D3XX
Link Video :
https://youtu.be/CK79fhYBePI
function preload(){
foto = loadImage('suprit.jpg');
function setup() {
createCanvas(720, 720);
warnaAsli = color(0);
warnaOlah = color(0);
merahOlah = color(0);
hijauOlah = color(0);
biruOlah = color(0);
noLoop();
function draw() {
background(255);
foto.resize(360, 360);
fotoGrey.loadPixels
fotoGrey.set(i, j, warnaOlah);
fotoGrey.updatePixels();
fotoSepia.filter(POSTERIZE, 64);
fotoSepia.loadPixels(360, 360);
fotoSepia.updatePixels();
fotoNegative.filter(POSTERIZE, 64);
fotoNegative.loadPixels(360, 360);
fotoNegative.pixels[i * 4] = 255 - r;
fotoNegative.pixels[i * 4 + 1] = 255 - g;
fotoNegative.pixels[i * 4 + 2] = 255 - b;
fotoNegative.updatePixels();
image(foto, 0, 0);
textSize(50);
fill("yellow");
image(fotoGrey, 360,0);
textSize(50);
image(fotoSepia, 0,360);
textSize(50);
image(fotoNegative, 360,360);
textSize(40);