depthmap commited on
Commit
af38345
·
verified ·
1 Parent(s): f228e15

Upload 6 files

Browse files
.gitattributes CHANGED
@@ -33,3 +33,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ lion-source.jpg filter=lfs diff=lfs merge=lfs -text
37
+ shaded-16bit.png filter=lfs diff=lfs merge=lfs -text
38
+ shaded-side-by-side.jpg filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -1,12 +1,19 @@
1
  ---
2
- title: 16bit Vs 8bit Depth Map Guide
3
- emoji: 🐠
4
- colorFrom: purple
5
  colorTo: yellow
6
  sdk: static
7
  pinned: false
8
  license: cc-by-4.0
9
- short_description: Why a 16-bit depth map changes a relief you can engrave or m
 
 
 
 
 
 
 
10
  ---
11
 
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: 16-bit vs 8-bit Depth Maps
3
+ emoji: 🗺️
4
+ colorFrom: gray
5
  colorTo: yellow
6
  sdk: static
7
  pinned: false
8
  license: cc-by-4.0
9
+ short_description: Why a 16-bit depth map changes an engraved or milled relief
10
+ tags:
11
+ - depth-estimation
12
+ - 3d-printing
13
+ - tutorial
14
+ - cnc
15
+ - laser
16
+ - static
17
  ---
18
 
19
+ A static explainer for the difference between a genuine 16-bit depth map and an 8-bit file of the same height field. Measurements and source files are in the companion dataset. The app lives in `index.html`.
index.html CHANGED
@@ -1,19 +1,95 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  </html>
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>16-bit vs 8-bit Depth Maps — Why bit depth shows up in the part</title>
7
+ <style>
8
+ :root { color-scheme: light dark; --fg: #111; --muted: #444; --bg: #f6f4ef; --card: #fff; --line: #ddd; --link: #0b57d0; }
9
+ @media (prefers-color-scheme: dark) {
10
+ :root { --fg: #f2f2f0; --muted: #b4b4b0; --bg: #161616; --card: #1e1e1e; --line: #333; --link: #8ab4f8; }
11
+ }
12
+ * { box-sizing: border-box; }
13
+ body { margin: 0; font: 18px/1.55 system-ui, -apple-system, Segoe UI, sans-serif; color: var(--fg); background: var(--bg); }
14
+ main { max-width: 880px; margin: 0 auto; padding: 32px 20px 64px; }
15
+ h1 { font-size: 1.8rem; line-height: 1.25; margin: 0 0 8px; }
16
+ h2 { font-size: 1.25rem; margin: 2rem 0 0.6rem; }
17
+ p, li { color: var(--fg); }
18
+ .muted { color: var(--muted); }
19
+ a { color: var(--link); }
20
+ .hero { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 24px 0; }
21
+ .hero figure { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
22
+ .hero img, .wide img, .source img { width: 100%; height: auto; display: block; }
23
+ figcaption { padding: 8px 12px 12px; font-size: 0.9rem; color: var(--muted); }
24
+ .wide, .source { margin: 16px 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
25
+ table { width: 100%; border-collapse: collapse; background: var(--card); }
26
+ th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 0.95rem; }
27
+ code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em; }
28
+ pre { background: var(--card); border: 1px solid var(--line); padding: 12px; overflow: auto; border-radius: 8px; }
29
+ .cta { margin-top: 2rem; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
30
+ @media (max-width: 640px) { .hero { grid-template-columns: 1fr; } }
31
+ </style>
32
+ </head>
33
+ <body>
34
+ <main>
35
+ <h1>From one photograph to a relief: why the depth map’s bit depth shows up in the part</h1>
36
+ <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>
37
+
38
+ <figure class="source">
39
+ <img src="lion-source.jpg" alt="Source photograph of a lion medallion">
40
+ <figcaption>The source photograph. The manufacturing file is a 16-bit grayscale PNG, not this JPEG.</figcaption>
41
+ </figure>
42
+
43
+ <h2>The same relief, two bit depths</h2>
44
+ <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>
45
+ <div class="hero">
46
+ <figure>
47
+ <img src="shaded-8bit.png" alt="Shaded 8-bit depth map showing terrace steps">
48
+ <figcaption>8-bit on a 10&nbsp;mm scale: this 3&nbsp;mm relief has 77 height steps. The terraces are the staircase.</figcaption>
49
+ </figure>
50
+ <figure>
51
+ <img src="shaded-16bit.png" alt="Shaded 16-bit depth map with a smoother surface">
52
+ <figcaption>16-bit of the same field: 19,662 distinct gray values, peaking at 19,661.</figcaption>
53
+ </figure>
54
+ </div>
55
+ <figure class="wide">
56
+ <img src="shaded-side-by-side.jpg" alt="Side-by-side shaded comparison of 8-bit and 16-bit reliefs">
57
+ <figcaption>Side-by-side shaded comparison published on the site’s 16-bit vs 8-bit guide.</figcaption>
58
+ </figure>
59
+
60
+ <h2>What we measured (15 November 2026)</h2>
61
+ <table>
62
+ <thead>
63
+ <tr><th>File</th><th>PNG header</th><th>Unique gray values</th><th>Min / max</th></tr>
64
+ </thead>
65
+ <tbody>
66
+ <tr><td>Genuine 16-bit manufacturing PNG</td><td>16-bit grayscale</td><td>19,662</td><td>0 / 19,661</td></tr>
67
+ <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>
68
+ <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>
69
+ </tbody>
70
+ </table>
71
+ <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>
72
+
73
+ <h2>How to check a file</h2>
74
+ <pre>from PIL import Image
75
+ im = Image.open("lion-depth-16bit.png")
76
+ print(im.mode) # I;16
77
+ print(len(set(im.getdata()))) # 19662
78
+ print(min(im.getdata()), max(im.getdata())) # 0 19661</pre>
79
+ <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>
80
+
81
+ <h2>What to do with the files</h2>
82
+ <ul>
83
+ <li>Send the 16-bit PNG to LightBurn in <strong>3D Sliced</strong> mode.</li>
84
+ <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>
85
+ <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>
86
+ </ul>
87
+
88
+ <div class="cta">
89
+ <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>
90
+ <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>
91
+ <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>
92
+ </div>
93
+ </main>
94
+ </body>
95
  </html>
lion-source.jpg ADDED

Git LFS Details

  • SHA256: 7d762f1dcc781748f3e61f2bacde4300d353bc3a70912ba27cd3fb492e82c69c
  • Pointer size: 131 Bytes
  • Size of remote file: 461 kB
shaded-16bit.png ADDED

Git LFS Details

  • SHA256: a1c0c7a5a4a5a7216aa955a2ddef0b2aec8b41408fc20cf1ed7006f9919f2625
  • Pointer size: 131 Bytes
  • Size of remote file: 152 kB
shaded-8bit.png ADDED
shaded-side-by-side.jpg ADDED

Git LFS Details

  • SHA256: a2034ecd31f37a2f2ac81215c0946e2201bffbd9a592401b0d6f95ec18d661b1
  • Pointer size: 131 Bytes
  • Size of remote file: 163 kB