filter(THRESHOLD);
filter(GRAY);
filter(INVERT);
filter(POSTERIZE);
filter(BLUR);
filter(OPAQUE);
filter(ERODE);
filter(DILATE);
The method has two different forms. The first as seen above just accepts the mode constant, as a parameter. The second accepts MODE and a number as an integer or float which represents the magnitude of the filter on the image.
ThresholdMode
Top-Left image has had a threshold filter of 0.1 applied.
Top-Right image has had a threshold filter of 0.5 applied.
Bottom-Left image has had a threshold filter of 0.9 applied.
Bottom-Right image has been added to the sketch folder and displayed on the screen.
An image must be added to the sketch and renamed 'c28.jpg' or the code can be edited with the name of another image.
Code to produce above image in Processing
int sizeWindow=700;
int fCount=0;
PImage a,b,c,d;
String fName="c28.jpg";
void setup(){
size(sizeWindow, sizeWindow);
a=loadImage(fName);
b=loadImage(fName);
c=loadImage(fName);
d=loadImage(fName);
//smooth();
//frameRate(.5);
noLoop();
}
void draw(){
image(a,0,0,width/2,height/2);
//b=get(0,0,width/2,height/2);
filter(THRESHOLD,.1);
image(b,width/2,0,width/2,height/2);
filter(THRESHOLD,.5);
image(c,0,height/2,width/2,height/2);
filter(THRESHOLD,.9);
image(c,width/2,height/2,width/2,height/2);
}
No comments:
Post a Comment