Levels

Introduced in the Artist Point release.

Adjusts input and output value ranges with midtone control, similar to Photoshop’s Levels tool.

When to Use

Levels does the work of an Expander, a Bias/Gain, and a Clamp in a single, more convenient device: it stretches the input range you choose to the full range, optionally shifts the midtones, and then fits the result into the output range you choose.

  • Normalizing terrain: Auto-detect levels with Output Levels left at the full range is a quick way to normalize terrain to use the full height range. The detected range is a snapshot: click it again if the upstream terrain changes.
  • Exaggerating relief: For heightfields, narrowing the Input Levels range exaggerates relief and increases contrast.
  • Tweaking masks: Levels is handy for tweaking masks produced by other devices, such as the flow, wear, or deposition masks from Erosion.
  • Defining edges: With Soft clipping, you can define an edge in a terrain without obliterating all of the detail within it.
Hard and soft clipping compared on a terrain
Hard clipping on the left, Soft clipping on the right

How to Use

Connect terrain or color data to the input. With the default settings the data passes through unchanged. The device provides automatic level detection, and shows input and output histograms in the parameter panel after a build.

  1. Click Auto-detect levels to automatically set the input range based on actual data.
  2. Adjust Input Levels to define which values map to the full output range:
    • Narrow the range to expand contrast
    • Shift the range to redistribute values
  3. Adjust Output Levels to set the final min/max bounds.
  4. Use Middle to adjust midtones:
    • For Gamma mode, values above 1.0 raise midtones, below 1.0 lower them
    • For Contrast mode, values above 1.0 increase contrast
  5. Enable Soft clipping to smooth harsh transitions at the boundaries.
  6. Review the Input Histogram and Output Histogram to verify results.

Inputs

PortTypeRequiredDescription
Primary InputHeightfield or RGBYesThe data to adjust
MaskHeightfieldOptionalControls effect intensity per-pixel

Outputs

PortTypeDescription
Primary OutputHeightfield or RGBThe adjusted output

Parameters

The Levels parameters
The Levels parameters, with the input and output histograms

Auto-detect levels (Button) – Sets the Input Levels range to the actual lowest and highest values in the incoming data (for RGB, the darkest and brightest gray levels). The device needs to have been built first, so it has input data to measure.

Input Levels (Default: the full range) – Defines which input values map to the output range. Values outside this range are clipped or soft-clipped. Shrinking this range expands the output dynamic range. Shown in your project’s elevation units; the default runs from zero to the project’s maximum height (black to white for RGB input).

Input Histogram (Report) – Shows the distribution of input values (brightness for RGB) after a build.

Output Levels (Default: the full range) – Defines the minimum and maximum values that will be present in the output. Shrinking this range reduces the output dynamic range. Shown in elevation units like Input Levels.

Output Histogram (Report) – Shows the distribution of output values after a build.

Midrange Adjust (Default: “Gamma”) – Choose the midtone adjustment method:

  • Gamma: Bends the midtones higher or lower while the lowest and highest values stay put
  • Contrast: Expands or contracts values around the middle

Middle (Default: 1.0, Range: 0.1-10.0) – Controls the midtone adjustment. 1.0 leaves the midtones unchanged:

  • For Gamma: Values above 1.0 raise (brighten) the midtones, values below 1.0 lower (darken) them
  • For Contrast: Values above 1.0 increase contrast, values below 1.0 reduce it
  • Uses a logarithmic slider, so most of its travel is spent near 1.0
  • Accepts spatial input for per-pixel control

Soft clipping (Default: false) – When enabled, values near and beyond the edges of the input range ease gradually into the minimum and maximum instead of being cut off sharply, avoiding hard flat plateaus and creases where the clipping starts. This is useful for defining an edge in a terrain without obliterating all of the detail within it.

Tips and Tricks

  • Input Levels controls which values in your source data become the minimum and maximum in the output.
  • Output Levels controls the actual range of values in the result.
  • Gamma mode is better for shifting the overall balance of low and high ground (or dark and light), while Contrast mode pushes values apart from, or together toward, the middle of the range.
  • The Middle parameter accepts spatial input, allowing variable gamma or contrast across the terrain.
  • Soft clipping produces more natural results when limiting extreme values.
Updated on December 2, 2026
Was this article helpful?

Related Articles

Need Support?
Can't find the answer you're looking for?
Contact Support

Start the discussion at forum.world-machine.com

Historical Comments

Leave a Comment