File size: 6,381 Bytes
af38345
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f228e15
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>16-bit vs 8-bit Depth Maps — Why bit depth shows up in the part</title>
  <style>
    :root { color-scheme: light dark; --fg: #111; --muted: #444; --bg: #f6f4ef; --card: #fff; --line: #ddd; --link: #0b57d0; }
    @media (prefers-color-scheme: dark) {
      :root { --fg: #f2f2f0; --muted: #b4b4b0; --bg: #161616; --card: #1e1e1e; --line: #333; --link: #8ab4f8; }
    }
    * { box-sizing: border-box; }
    body { margin: 0; font: 18px/1.55 system-ui, -apple-system, Segoe UI, sans-serif; color: var(--fg); background: var(--bg); }
    main { max-width: 880px; margin: 0 auto; padding: 32px 20px 64px; }
    h1 { font-size: 1.8rem; line-height: 1.25; margin: 0 0 8px; }
    h2 { font-size: 1.25rem; margin: 2rem 0 0.6rem; }
    p, li { color: var(--fg); }
    .muted { color: var(--muted); }
    a { color: var(--link); }
    .hero { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 24px 0; }
    .hero figure { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
    .hero img, .wide img, .source img { width: 100%; height: auto; display: block; }
    figcaption { padding: 8px 12px 12px; font-size: 0.9rem; color: var(--muted); }
    .wide, .source { margin: 16px 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
    table { width: 100%; border-collapse: collapse; background: var(--card); }
    th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 0.95rem; }
    code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em; }
    pre { background: var(--card); border: 1px solid var(--line); padding: 12px; overflow: auto; border-radius: 8px; }
    .cta { margin-top: 2rem; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
    @media (max-width: 640px) { .hero { grid-template-columns: 1fr; } }
  </style>
</head>
<body>
  <main>
    <h1>From one photograph to a relief: why the depth map’s bit depth shows up in the part</h1>
    <p class="muted">A measurable comparison of a genuine 16-bit depth map and an 8-bit file of the same height field, using the public lion-medallion sample from <a href="https://depth-map.com/" target="_blank" rel="noopener">Depth-Map.com</a>.</p>

    <figure class="source">
      <img src="lion-source.jpg" alt="Source photograph of a lion medallion">
      <figcaption>The source photograph. The manufacturing file is a 16-bit grayscale PNG, not this JPEG.</figcaption>
    </figure>

    <h2>The same relief, two bit depths</h2>
    <p>Shaded previews exaggerate height so the steps are visible. These two illustrations are 8-bit RGB pictures of the height field, not the manufacturing files themselves.</p>
    <div class="hero">
      <figure>
        <img src="shaded-8bit.png" alt="Shaded 8-bit depth map showing terrace steps">
        <figcaption>8-bit on a 10&nbsp;mm scale: this 3&nbsp;mm relief has 77 height steps. The terraces are the staircase.</figcaption>
      </figure>
      <figure>
        <img src="shaded-16bit.png" alt="Shaded 16-bit depth map with a smoother surface">
        <figcaption>16-bit of the same field: 19,662 distinct gray values, peaking at 19,661.</figcaption>
      </figure>
    </div>
    <figure class="wide">
      <img src="shaded-side-by-side.jpg" alt="Side-by-side shaded comparison of 8-bit and 16-bit reliefs">
      <figcaption>Side-by-side shaded comparison published on the site’s 16-bit vs 8-bit guide.</figcaption>
    </figure>

    <h2>What we measured (15 November 2026)</h2>
    <table>
      <thead>
        <tr><th>File</th><th>PNG header</th><th>Unique gray values</th><th>Min / max</th></tr>
      </thead>
      <tbody>
        <tr><td>Genuine 16-bit manufacturing PNG</td><td>16-bit grayscale</td><td>19,662</td><td>0 / 19,661</td></tr>
        <tr><td>Same field saved as 8-bit (<code>value // 257</code>)</td><td>8-bit grayscale</td><td>77</td><td>0 / 76</td></tr>
        <tr><td>8-bit written back into a 16-bit container (<code>value * 257</code>)</td><td>16-bit grayscale</td><td>77 (all multiples of 257)</td><td>0 / 19,532</td></tr>
      </tbody>
    </table>
    <p>Depth-Map.com writes depth on a 10&nbsp;mm scale: 65,535 maps to 10&nbsp;mm. A 3&nbsp;mm relief therefore uses less than a third of the range, so the brightest pixel is 19,661, not 65,535. That is expected. A fake 16-bit file is the one whose header says 16-bit but whose unique-value count is 256 or fewer.</p>

    <h2>How to check a file</h2>
    <pre>from PIL import Image
im = Image.open("lion-depth-16bit.png")
print(im.mode)                 # I;16
print(len(set(im.getdata())))  # 19662
print(min(im.getdata()), max(im.getdata()))  # 0 19661</pre>
    <p>Or use ImageMagick: <code>identify -verbose your-depth-map.png</code> and read the gray channel min/max. The source files, hashes, and a small <code>verify.py</code> script are in the companion dataset.</p>

    <h2>What to do with the files</h2>
    <ul>
      <li>Send the 16-bit PNG to LightBurn in <strong>3D Sliced</strong> mode.</li>
      <li>Import the closed STL into a slicer or a CAM tool. The site’s published sample was exported at 3&nbsp;mm relief on a 1.5&nbsp;mm base, with invert on.</li>
      <li>If you need a mechanical part with exact dimensions, model it in CAD. A single photograph is a height field, not a dimensionally accurate solid.</li>
    </ul>

    <div class="cta">
      <p><strong>Files and measurements:</strong> the companion dataset <a href="https://huggingface.co/datasets/depthmap/16bit-vs-8bit-depth-maps" target="_blank" rel="noopener">depthmap/16bit-vs-8bit-depth-maps</a> (published with this Space).</p>
      <p><strong>Longer write-up:</strong> <a href="https://depth-map.com/guides/16-bit-vs-8-bit-depth-maps" target="_blank" rel="noopener">16-bit vs 8-bit guide</a> on Depth-Map.com.</p>
      <p><strong>Generate your own 16-bit PNG and closed STL</strong> from a photo, including this sample, at <a href="https://depth-map.com/" target="_blank" rel="noopener">depth-map.com</a>. Three photos a day do not require an account.</p>
    </div>
  </main>
</body>
</html>