16-Bit PNG Heightmaps vs 8-Bit Grayscale: Eliminating CNC Relief & Fiber Laser Stair-Stepping

2026-11-29来源 dev.toEnglish

Anyone who has carved a portrait relief in walnut on a 3-axis CNC router—or run a 3D Slice pass on a MOPA fiber laser—has seen the same frustrating defect: concentric contour rings ("stair-stepping" or terracing) across cheeks, foreheads, and smooth bevels.

Makers often blame their ball-nose stepover or spindle backlash. In practice, more than half the time the stair-stepping is baked directly into the source image before the CAM toolpath is ever generated—because the depth map was exported as an 8-bit grayscale PNG/JPG instead of a 16-bit PNG heightmap or watertight STL mesh.

This engineering breakdown walks through the exact Z-axis resolution math, ball-nose cusp formulas, and LightBurn 3D Slice parameters for converting 2D photos into clean CNC and fiber laser bas-reliefs.

1. The Z-Axis Math: Why 8-Bit Causes Visible Terracing

A grayscale heightmap maps pixel brightness (0 = black / deepest cut, max = white / highest point) to physical Z-axis depth.

  • 8-bit grayscale (2^8 = 256 discrete levels):
    ΔZ_8bit = Z_depth / 255
    On a standard 6.0 mm hardwood portrait relief, every single gray value jump equals 0.0235 mm (23.5 microns). Worse, portrait faces rarely span the full 0–255 range—skin tones often occupy only 40–60 gray levels, pushing effective step height past 0.10 mm (100 microns). That is easily visible to the naked eye and leaves concentric contour rings even under a 0.5 mm tapered ball-nose bit.

  • 16-bit grayscale PNG (2^16 = 65,536 discrete levels):
    ΔZ_16bit = Z_depth / 65,535
    On the exact same 6.0 mm relief, each discrete Z-step shrinks to 0.0000916 mm (0.09 microns)—a 257× improvement in vertical precision, completely below the mechanical resolution of any hobby or commercial CNC router or galvo fiber laser.

Relief Z-Depth 8-Bit Step Height 16-Bit Step Height Practical Surface Finish (Hardwood / Brass)
1.5 mm (Brass Coin / Fiber Laser) 5.88 µm 0.023 µm 8-bit shows subtle banding on smooth gradients; 16-bit is optically smooth
4.0 mm (MDF / Plaque) 15.69 µm 0.061 µm 8-bit requires heavy sanding; 16-bit needs light sealing only
6.0 mm (Hardwood Portrait) 23.53 µm 0.092 µm 8-bit shows pronounced terracing on faces; 16-bit carves cleanly
12.0 mm (Deep Sign Relief) 47.06 µm 0.183 µm 8-bit unusable without aggressive mesh smoothing; 16-bit stays crisp

2. Matching Pixel Resolution to Your Ball-Nose Bit or Laser Spot

Oversampling a heightmap to 8000 × 8000 px bloats STL triangle counts without improving physical detail, while undersampling produces jagged edges along hairlines and lettering.

A reliable rule of thumb for XY sampling density:

  • CNC Tapered Ball-Nose Finishing: Target 2–3 pixels per finishing stepover (stepover = 8%–10% of ball diameter). For a 1.0 mm diameter ball-nose bit (0.5 mm radius) running 10% stepover (0.10 mm), 0.05 mm/px (20 px/mm) captures every feature the cutter can physically resolve. On a 150 × 200 mm plaque, that is 3000 × 4000 px.
  • Fiber Laser (LightBurn 3D Sliced): Typical galvo focused spot size is 0.03–0.05 mm. Setting image resolution near 0.04–0.05 mm/px (500–635 DPI) matches the physical kerf without stalling LightBurn's slicing engine.

Theoretical Scallop / Cusp Height Formula

For CNC finishing passes with ball radius R and stepover s:
h_cusp = R - sqrt(R^2 - (s / 2)^2)
Keeping s <= 0.10 × (2R) keeps cusp height under ~0.0025 mm on a 1 mm ball-nose cutter, eliminating cross-grain tool marks.

3. Comparing Photo-to-3D Relief Generators in 2026

Tool 16-Bit PNG Heightmap Watertight STL Export Live Relief Controls (Smoothing / Depth / Border) Workflow Fit
DepthCarve Yes (16-bit PNG) Yes (direct STL) Yes (browser-local live 3D preview & sliders) CNC wood reliefs, brass coins, LightBurn 3D Slice, Aspire/VCarve
SculptOK Yes Yes Good Portrait engraving
Owl3D Depth map export Limited Video/stereo oriented 2D-to-3D stereo video & photos
Depth-Map.com 8-bit / 16-bit Add-on Basic Quick depth previews
Vectric Aspire / Carveco Imports external heightmaps Full CAM modeling Full desktop CAD/CAM Downstream toolpath generation ($350–$1,995)

4. Practical Export Checklist Before Opening Aspire or LightBurn

  1. Always check bit depth before importing: Run file relief.png or check image properties to confirm 16-bit/color grayscale (not 8-bit RGB saved from a screenshot).
  2. Invert Z for intaglio / stamps: Raised coins and plaques put foreground details in white (65535); recessed wax seals and leather stamps require inverting the heightmap before slicing.
  3. Verify STL manifoldness: Before sending an STL to Vectric VCarve/Aspire or Fusion 360, confirm a closed backplane thickness (>= 1.5 mm base) so roughing passes never plunge through zero.

Interactive Calculator & Open Reference

原文:https://www.a8q9.cn/en/article/16-bit-png-heightmaps-vs-8-bit-grayscale-eliminating-cnc-relief-fiber-laser-stai-c22eb0.html

相关文章