Studio Yotsuba
Back to Node List

Height From Image

height_from_image

Estimates a height map from a plain image. Silhouette mode inflates the shape from its outline; luminance and alpha modes read pixel values directly.

Reviewed
Guide available

Input Ports

NameTypeDescription
Image
input
Image
Required
Image to estimate a height map from.

Output Ports

NameTypeDescription
Height
output
Image
Estimated height map. White is high, black is low. Connect it to the Height input of Image to Surface before Surface Light Preview.

Parameters

NameTypeDefaultRangeDescription / Options
Mode
mode
Enum
Silhouette—

How to read height from the image.

  • SilhouetteSilhouette
    Inflates the opaque shape: closer to the center is higher. Works for flat-colored sprites.
  • LuminanceLuminance
    Brighter pixels are higher. Works when shading is already painted.
  • AlphaAlpha
    More opaque pixels are higher.
Shape
profile
Enum
Round—

How the shape swells from the outline toward the center.

  • RoundRound
    Rounded like a balloon. Good for characters and soft objects.
  • LinearLinear
    Rises straight like a cone. Good for crystals and spikes.
Flat Top
plateau
Float
00–0.9 / step 0.05

Flattens the center at full height. Good for bricks and boxes.

Invert
invert
Bool
false—

Swap high and low. Use for dents and holes.

Overview

The entry point for turning hand-drawn art into 3D: it estimates a height map (white = high) from an ordinary 2D image. Even a flat-color sprite can be inflated from its silhouette for a rounded sense of depth. Use the output for lighting—such as the height input of image_to_surface—or as a map for slope_blur.

Usage tips

  • Choose the mode by source: flat-color art → Silhouette, which inflates from the outline; already shaded art → Luminance, which uses brightness directly as height.
  • Set the Silhouette shape with profile: character or rounded object → Round; crystal or spike → Linear; brick or box → Round plus plateau around 0.5 for a flat top.
  • The go-to pipeline is image_load → height_from_image → image_to_surface(Height input) → surface_light_preview. It adds light and shadow to hand-drawn art after the fact.
  • The output is an Image, so it cannot connect directly to the Surface input of surface_light_preview; route it through image_to_surface.
  • It is also useful as a map for slope_blur, letting patterns flow along the shape of the artwork itself.

Common pitfalls

  • Internal relief such as a recessed window is missing: Silhouette mode estimates from outline information only (see "Limitations" below). Reuse painted shading with Luminance, or draw the height map by hand.
  • The height is jagged: an anti-aliased input edge destabilizes the silhouette. Insert threshold(Alpha) upstream to create a clean binary silhouette.
  • The shape bulges when it should be recessed: turn invert ON to carve inward.

Technical details

  • Silhouette: applies a chamfer 3-4 distance transform to the alpha silhouette, creating a height field that rises with distance from the edge. Round uses a hemispherical cross-section; Linear is conical. plateau caps the center at maximum height.
  • Luminance: reads pixel luminance directly as height, making it suitable for reusing already-painted shading.
  • Alpha: reads opacity directly as height.
  • Transparent pixels remain transparent in the output.

Examples

  • Use image_load → height_from_image → image_to_surface(Height input) → surface_light_preview to light a flat-color sprite after the fact.
  • Turn 反転 ON to create recessed ornament or engraving.

Limitations

Because the estimate uses only the silhouette outline, it cannot represent internal relief such as a recessed window in a house. Draw the height map by hand when internal steps are needed, or reuse painted shading with 明るさ mode.

Related nodes

  • image_to_surface — incorporate the height map into a Surface for lighting
  • quick_shade — beginner-friendly one-node inflation and lighting
  • slope_blur — flow a pattern along height-map slopes
  • distance_field — when you need the distance field itself
Back to Node List