bluering.nl contact mail a message

Methods

static int color(int r,int g,int b,int alpha)

Create a pixelvalue for the color described by the given channel values. Choose alpha=255 for a nontransparent color.

int gray(int v,int alpha)

return a shade of gray. is equal to color(v,v,v,alpha).

int red(int v)

the amount of red in the pixelvalue. returns a value between of 0, 255 or inbetween

int green(int v)

idem

int blue(int v)

idem

int alpha(int v)

the amount of transparency in the pixelvalue. returns a value between of 0, 255 or inbetween

static int dcolor(double r,double g,double b,double a)

Does the same as color but takes floating point numbers. return the pixelvalue for the indicated color. r is the amount of red: 0(no red) to 1(full red). g is the amount of green: 0(no green) to 1(full green) b is the amount of red: 0(no red) to 1(full blue) a is the amount of alpha: 0(completely transparent) to 1(fully opaque)

void HSB(int c)

Set the image with the gray value corresponding to its hue, saturation of brightness. c=0 will give hue, c=1 saturation and c=2 brightness

void copyred(Image24 src)

void copygreen(Image24 src)

void copyblue(Image24 src)

void copyalpha(Image24 src)

Set the red,green, blue or alpha channel of this image with the average value from the given source.

void setHSBchannel(Image24 src,int c)

set the Hue, Sat or Brightness of this image according to the average of the source. c=0 is hue, c=1 saturation and c=2 brightness

void combineHSL(Image24 hue,Image24 sat, Image24 bright)

Set this image with the HSB-colr obtained by combining the source images.

int avg(int v,int r,int g,int b,int s)

return the average of the red, green and blue in the pixel

int avg(int v)

The standard average. This is defined as avg(v,299,587,114,1000). So green is more important, and blue less. This seems odd, but gives more pleasing results.

void pseudocolor()

Convert this image to grayscale, and then replace the gray values with a bright color in a continuous fashion.
fade.fill(0);
fade.replacegradient(0,0,0,im.sx-1,im.sy-1,
im.color(255,220,240,255),im.color(0,30,0,255));

void gray()

Convert this image to grayscale. Aftwerwards it will not show colors but only shades of gray, and the shade of gray depends on the average value of the pixel.

void red()

Convert this image to grayscale. Aftwerwards it will not show colors but only shades of gray, and the shade of gray depends on the red value of the pixel. The alpha channel will not change, so transparency is preserved.

void green()

Convert this image to grayscale. Aftwerwards it will not show colors but only shades of gray, and the shade of gray depends on the green value of the pixel. The alpha channel will not change, so transparency is preserved.

void blue()

Convert this image to grayscale. Aftwerwards it will not show colors but only shades of gray, and the shade of gray depends on the blue value of the pixel. The alpha channel will not change, so transparency is preserved.

void alpha()

Convert this image to grayscale. Aftwerwards it will not show colors but only shades of gray, and the shade of gray depends on the alpha value of the pixel. The alpha value of each pixel afterwards will be 255.

void avg(int r,int g,int b,int s)

Convert this image to grayscale. Aftwerwards it will not show colors but only shades of gray, and the shade of gray depends on the weighted sum of the red, green and blue values of the pixel. (with r,g and b the relative weights, and s the sum of these weights). The alpha value of each pixel afterwards will be 255.
[click here if you see no menu]