apply_color_curve
Remap pixel tones through a custom curve to adjust brightness and contrast selectively across RGB or individual channels while preserving palette colors and transparency.
Instructions
Remap every tone through a curve: the tonal control brightness and contrast lack.
Brightness moves every tone by the same amount and contrast pivots them all around
the middle. A curve says what each input tone becomes, so shadows can be lifted
without touching the highlights, a flat midrange pulled apart while the ends stay
pinned, or one channel warmed on its own.
**It cannot add a colour.** A curve maps each input tone to exactly one output tone,
so a sprite drawn in five colours comes out in five colours or fewer, and no pixel
becomes part transparent. That is what separates this from a convolution kernel
(blur, sharpen, emboss), which on a clean five-colour orb produced 89 colours and 208
semi-transparent pixels, measured. Curves are safe on finished pixel art; kernels are
not, which is why this server exposes the one and not the other.
Args:
points: The curve's corners, as `[[input, output], ...]` with every value from 0
to 255 and the inputs climbing. `[[0, 0], [128, 192], [255, 255]]` lifts the
midtones and pins the ends; `[[0, 255], [255, 0]]` inverts; a single point
flattens every tone to its output. Between corners the curve runs straight,
and outside the first and last it holds their values, which is what Aseprite's
own Color Curve does (measured, and reproduced here rather than called, so the
selection, the pixel counters and indexed palettes all behave as they do for
every other pass).
channel: "rgb" (default) moves all three together, or "red", "green" or "blue"
for one. A grayscale sprite takes "rgb", which moves its single value.
layer: Target layer (default: the top one). frame: 1-based.
Only drawn pixels are visited, as with every other per-pixel pass here, so a curve
never fills in transparent canvas.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"filename": "<filename>",
"points": "<points>"
},
"name": "apply_color_curve"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| frame | No | Default: 1. | |
| layer | No | ||
| points | Yes | ||
| channel | No | Default: "rgb". | rgb |
| filename | Yes |