Upload 6 files
Browse files- .gitattributes +3 -0
- README.md +12 -5
- index.html +94 -18
- lion-source.jpg +3 -0
- shaded-16bit.png +3 -0
- shaded-8bit.png +0 -0
- shaded-side-by-side.jpg +3 -0
.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:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
---
|
| 11 |
|
| 12 |
-
|
|
|
|
| 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 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 mm scale: this 3 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 mm scale: 65,535 maps to 10 mm. A 3 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 mm relief on a 1.5 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
|
shaded-16bit.png
ADDED
|
Git LFS Details
|
shaded-8bit.png
ADDED
|
shaded-side-by-side.jpg
ADDED
|
Git LFS Details
|