contrast

Syntax

int contrast(int pixel, int contrast)

Arguments

pixel
The pixel color value the contrast algorithm will be applied to.
contrast
The amount of contrast to apply on a range of -127 to 128, with 0 meaning no contrast adjustment.

Return

The new pixel color value after contrast is applied.

Description

Applies a simple contrast effect to a given pixel value.

Example

ctl[0]: "Contrast", Range=(-127,128), Val=0

ForEveryTile: {
  for (y = y_start; y < y_end; y++) {
    for (x = x_start; x < x_end; x++) {
       for (z=0; z < 3; z++) {
          pset(x,y,z, contrast(src(x,y,z), ctl(0)));
       }
    }
  }
  return true;
}

See Also

blend, gamma, gray, saturation