bluering.nl contact mail a message

These operations act pizelwise: the new value of a pixel depends only on the previous value of that pixel.

Methods

/** * splits the image according to avg */

void band(int[] colors)

splits the image according to average value: It is some sort of threshol operation, but you can give any number of colors as parameter.
int[] palette={out.color(0,0,255,255),out.color(100,0,100,255),
out.color(200,0,30,255),out.color(255,150,150,255)};
out.band(palette);

void threshold(int vdark,int vlight,int minlight)

split the image in a high and low part. vdark is the color of the low part vlight the color of the high part and minlight the minimal average value for a pixel to become high.
out.threshold(im.color(25,25,150,255),im.color(200,200,255,255),140);

invert(boolean flipr,boolean flipg,boolean flipb,boolean flipa)

Invert the colors of the image. Only the channels whose parameter is true are inverted. invert(true,true,true,false) is the most common invert operation, but others can be interesting.
out.invert(true,true,false,false);

void brightness(int difr,int difg,int difb,int difa)

Adjust the brightness of each channel. The difs must be between -255 and 255, and for each pixel that value will be added by that channel.

gamma(double gr,double gg,double gb,double ga)

do gamma correction on each channel separately
out.gamma(0.8,1.5,1.2,1);

contrast(double sr,double sg,double sb,double sa)

adjust the contrast for each channel. sr is adjustment parameter for the red channel. A value greater than 1 will increase red difference, a value below 1 will weaken the red differences. The same for sg, sb, sa.

void linear(double sr,double dr,double sg,double dg, double sb,double db,double sa, double da)

do a linear transformation on each channel of each pixel according to the formula newred=oldred*sr+dr. Similar for green, blue and alpha.

void linearmod(double sr,double dr,double sg,double dg, double sb,double db,double sa, double da)

do a linear transformation on each channel of each pixel according to the formula newred=oldred*sr+dr. If the outcome exceeds the possible values, it is wrapped around: -1 becomes 255, and 260 becomes 4.
ut.linearmod(2,0,1,0,4,0,1,0);

[click here if you see no menu]