tone

Syntax

int tone(int pixel, int h, int m, int d)

Arguments

pixel
The pixel color value to modify
h
Highlight adjustment, range -127 to 128
m
Midtone adjustment, range -127 to 128
d
Darkness adjustment, range -127 to 128

Return

The newly toned pixel value.

Description

Applies a simple highlight / midtone / darkness tone effect to the image.

Example

ctl[0]: "Highlights", Range=(-127,128), Val=0
ctl[1]: "Midtone", Range=(-127,128), Val=0
ctl[2]: "Darkness", 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, tone( src(x,y,z), ctl(0), ctl(1), ctl(2) ));
       }
    }
  }
  return true;
}

See Also

blend, contrast, gamma, saturation