Yotsuba Games
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
The node name and summary are available in English. Port, parameter, and article details are currently shown in Japanese.

Input Ports

NameTypeDescription
็”ปๅƒ
input
Image
Required
้ซ˜ใ•ใƒžใƒƒใƒ—ใ‚’ๆŽจๅฎšใ—ใŸใ„็”ปๅƒใงใ™ใ€‚

Output Ports

NameTypeDescription
้ซ˜ใ•
output
Image
ๆŽจๅฎšใ—ใŸ้ซ˜ใ•ใƒžใƒƒใƒ—ใงใ™ใ€‚็™ฝใ„ใปใฉ้ซ˜ใใ€้ป’ใ„ใปใฉไฝŽใใชใ‚Šใพใ™ใ€‚ใ€Œ็”ปๅƒใ‹ใ‚‰ใ‚ตใƒผใƒ•ใ‚งใƒผใ‚นใ€ใฎ้ซ˜ใ•ๅ…ฅๅŠ›ใซใคใชใ’ใพใ™ใ€‚

Parameters

NameTypeDefaultRangeDescription / Options
่ชญใฟๅ–ใ‚Šๆ–น
mode
Enum
Silhouetteโ€”

็”ปๅƒใฎใฉใ“ใ‹ใ‚‰้ซ˜ใ•ใ‚’่ชญใฟๅ–ใ‚‹ใ‹ใงใ™ใ€‚

  • ใ‚ทใƒซใ‚จใƒƒใƒˆSilhouette
    ไธ้€ๆ˜Žใชๅฝขใ‚’่†จใ‚‰ใพใ›ใพใ™ใ€‚่ผช้ƒญใ‹ใ‚‰้›ขใ‚Œใฆไธญๅฟƒใซ่ฟ‘ใ„ใปใฉ้ซ˜ใใชใ‚Šใพใ™ใ€‚ใƒ™ใ‚ฟๅก—ใ‚Šใฎใƒ‰ใƒƒใƒˆ็ตตใงไฝฟใˆใพใ™ใ€‚
  • ๆ˜Žใ‚‹ใ•Luminance
    ๆ˜Žใ‚‹ใ„ใƒ”ใ‚ฏใ‚ปใƒซใปใฉ้ซ˜ใใชใ‚Šใพใ™ใ€‚้™ฐๅฝฑใŒๆ—ขใซๅก—ใ‚‰ใ‚Œใฆใ„ใ‚‹็ตตใงไฝฟใˆใพใ™ใ€‚
  • ไธ้€ๆ˜ŽๅบฆAlpha
    ไธ้€ๆ˜Žใชใƒ”ใ‚ฏใ‚ปใƒซใปใฉ้ซ˜ใใชใ‚Šใพใ™ใ€‚
็ซ‹ไฝ“ใฎๅฝข
profile
Enum
Roundโ€”

่ผช้ƒญใ‹ใ‚‰ไธญๅฟƒใธๅ‘ใ‹ใ†็››ใ‚ŠไธŠใŒใ‚Šๆ–นใงใ™ใ€‚

  • ไธธใ„Round
    ้ขจ่ˆนใฎใ‚ˆใ†ใซไธธใ่†จใ‚‰ใฟใพใ™ใ€‚ใ‚ญใƒฃใƒฉใ‚ฏใ‚ฟใƒผใ‚„ๆŸ”ใ‚‰ใ‹ใ„็‰ฉใซๅ‘ใใพใ™ใ€‚
  • ใจใŒใ‚‹Linear
    ๅ††้Œใฎใ‚ˆใ†ใซ็›ด็ทš็š„ใซ็››ใ‚ŠไธŠใŒใ‚Šใพใ™ใ€‚็ตๆ™ถใ‚„ใƒˆใ‚ฒใซๅ‘ใใพใ™ใ€‚
ๅคฉ้ขใฎๅนณใ‚‰ใ•
plateau
Float
00โ€“0.9 / step 0.05

ไธญๅฟƒๅดใ‚’ๆœ€ๅคง้ซ˜ใ•ใงๅนณใ‚‰ใซใ—ใพใ™ใ€‚ใƒฌใƒณใ‚ฌใ‚„็ฎฑใฎใ‚ˆใ†ใชๅฝขใซๅ‘ใใพใ™ใ€‚

ๅ่ปข
invert
Bool
falseโ€”

้ซ˜ไฝŽใ‚’ๅ…ฅใ‚Œๆ›ฟใˆใพใ™ใ€‚ใใผใฟใ‚„็ฉดใ‚’ไฝœใ‚‹ๆ™‚ใซไฝฟใ„ใพใ™ใ€‚

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
Height From Image โ€” PixPipeline Node Reference