Skip to content

Commit

Permalink
prcsng update
Browse files Browse the repository at this point in the history
  • Loading branch information
belligerentcrow committed Sep 22, 2024
1 parent b44c6de commit 627d87f
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
PImage Im, ImN, ImG, ImL;
void setup(){
size(500,500);
Im = loadImage("napule.png");
ImG = loadImage("yuri.jpg");
Im.resize(256,256);
ImG.resize(256,256);
image(Im,0,0);


ImN = negativo(Im);
ImL = negativo(ImG);
image(ImL,0,256);
image(ImN,256,0);
image(ImG,256,256);
}



PImage negativo(PImage I){
PImage R = I.copy();
R.loadPixels();

float r,g,b;
for(int i=0; i<R.pixels.length;i++){
r = 255-red(R.pixels[i]);
g = 255-green(R.pixels[i]);
b = 255-blue(R.pixels[i]);

R.pixels[i] = color(r,g,b);
}
R.updatePixels();
return R;
}

0 comments on commit 627d87f

Please sign in to comment.