展示HN: 曾经想过用盲文看看自己吗?
Show HN: Ever wanted to look at yourself in Braille?

原始链接: https://github.com/NishantJoshi00/dith

## Dith:基于终端的图像抖动 “Dith”是一个用Zig编写的命令行工具,它使用五种经典的抖动算法(边缘、Atkinson、Floyd-Steinberg、蓝噪声和Bayer)将图像或实时摄像头馈送转换为类似盲文的图案。 它被设计为简单易用,仅需要Zig 0.15.1+和macOS的摄像头功能,没有外部依赖。用户可以指定输入源(摄像头或文件 - PNG、JPEG、BMP)、抖动模式,并调整诸如灵敏度(+threshold)和颜色反转(+invert)等参数。 每种抖动模式都提供独特的美学效果,从类似草图的轮廓到平滑的渐变和复古的8位图案。该工具内置了macOS原生摄像头集成,并提供优化性能的选项。安装涉及克隆GitHub仓库,使用Zig构建,并将二进制文件添加到您的PATH中。 在这里找到它:[https://github.com/user/dith](https://github.com/user/dith)

## 展示 HN:盲文图像渲染 一位 Hacker News 用户分享了一个项目 ([github.com/nishantjoshi00](https://github.com/nishantjoshi00)),该项目尝试使用终端字符集中的盲文字符来渲染图像。然而,评论者很快指出输出不符合标准盲文,标准盲文使用六点或八点单元格。 这次讨论引发了关于为视障人士提供触觉表示的更广泛的对话。用户讨论了现有的技术,如动态盲文显示器和图像及平面图的 3D 打印触觉模型。一位盲人用户分享了他们的经验,指出他们可以理解 2D 盲文图形,但难以从 2D 表示中想象 3D 对象——这个问题可能可以通过 3D 打印解决。 该帖子还涉及了空间推理的挑战,以及盲人个体在处理复杂的图表或像透视这样的概念时,是否能够以类似于视力正常人士的方式处理信息。一位评论员批评了这个项目,建议创建者专注于原创作品。
相关文章

原文

dith demo

Ever wanted to look at yourself... in Braille?

Plug in your webcam or throw any image at it: PNG, JPEG, BMP, whatever. 5 classic dithering algorithms render it live in your terminal.

Built in Zig with native macOS camera integration. No dependencies, just vibes.

Dither anything:

# Live camera feed
dith +source=cam +mode=atkinson

# Any image file
dith +source=file +mode=blue_noise +path=photo.png

5 classic dithering algorithms:

Mode Best For
edge Line art, sketches, outlines
atkinson High contrast, classic Mac aesthetic
floyd_steinberg Photos, smooth gradients
blue_noise Organic, film-grain look
bayer Retro 8-bit, crosshatch pattern

Fine-tune the output:

# Adjust sensitivity
dith +source=cam +mode=edge +threshold=50

# Invert colors
dith +source=file +mode=bayer +path=image.jpg +invert

Requirements: Zig 0.15.1+, macOS (for camera source)

git clone https://github.com/user/dith
cd dith
zig build -Doptimize=ReleaseFast

Binary is at ./zig-out/bin/dith. Add it to your PATH or copy it somewhere convenient.

dith +source=<SOURCE> +mode=<MODE> [options...]

Camera - live feed from your webcam

dith +source=cam +mode=edge
dith +source=cam +mode=atkinson +warmup=5      # more warmup frames
dith +source=cam +mode=blue_noise +strategy=direct   # no background capture

File - PNG, JPEG, or BMP

dith +source=file +mode=floyd_steinberg +path=photo.png
dith +source=file +mode=bayer +path=~/Downloads/image.jpg +invert
Option Description Default
+threshold=N Sensitivity 0-255 varies by mode
+invert Flip black/white off
+warmup=N Camera warmup frames 3
+strategy= pipelined or direct pipelined
# Sketch-like edge detection
dith +source=file +mode=edge +path=drawing.png +threshold=5

# Classic Macintosh dithering
dith +source=file +mode=atkinson +path=photo.jpg

# Smooth photo dithering
dith +source=cam +mode=floyd_steinberg +threshold=140

# Cinematic grain
dith +source=file +mode=blue_noise +path=portrait.png

# Retro game aesthetic
dith +source=cam +mode=bayer +invert
# Run tests
zig build test

# Debug build
zig build

# Release build
zig build -Doptimize=ReleaseFast

# Build and run
zig build run -- +source=cam +mode=edge

PRs welcome.

联系我们 contact @ memedata.com