工具与资源mzucker.github.io
压缩并增强手写笔记(2016)
Compressing and enhancing hand-written notes (2016)
2016 — 2021,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
这是 Matt Zucker 介绍 noteshrink 的文章:它把扫描或拍照得到的手写笔记做颜色聚类、背景提亮和降色压缩,输出体积很小、适合打印的 PDF/PNG。文中展示了处理前后的对比,并解释背后的简单图像处理步骤。
为什么经久不衰:它用可复现的简单算法解决了“扫描笔记又大又灰”的常见痛点,脚本开源、效果肉眼可见,所以多年后仍被反复翻出来。
HN 评论精选
高分辨率扫描后再降采样重编码,通常优于扫描仪直接输出低分辨率 JPG;厂商可能为速度牺牲了编码质量。
我观察到:先以很高分辨率扫描成 JPG,再用 Photoshop 等重新编码到目标低分辨率,文件质量和体积总比直接低分辨率扫描更好。我猜扫描仪厂商为了标称每分钟页数,选了编码最快的 JPG 配置,而不是质量/体积最优的配置。
alister查看英文原文
I have an observation about scanning documents that results in good quality and smaller files, but I can't satisfactorily explain why it works. Consider these two cases: (1) Scan document at very high resolution as a JPG and then use a third-party program (like Photoshop or whatever) to re-encode the JPG at your preferred low resolution. (2) Scan document at your preferred low resolution as a JPG straight away. Don't re-encode afterward. Intuition says that the results of #1 vs #2 should be identical, or that #1 should be worse because you're doing two passes on source material. But I always get better results with case #1 (i.e., high-res scan and re-encoding afterward) regardless of the type or model of scanner, or whether the scanner does the JPG encoding on-board the device itself or through a Windows/Linux/Mac driver bundled with the scanner. My theory is that scanner manufacturers are deliberately choosing the JPG encoding profile that gets them the fastest result. They want to brag about pages per minute which is an easily measured metric. Quality of JPG encoding and file size take effort to compare, but everyone understands pages per minute. If anyone has contrary experience I'd like to hear it. I've been seeing this for years with different document scanners and flatbed scanners -- regardless of how I tweak the scanner's settings, I can always get good quality in a small file by re-encoding afterward.
背面透字主要来自白色盖板反光;开盖在暗室扫描可避免。
扫描件上能看到纸张背面的字迹透过来。我的经验是:用平板扫描仪时打开盖子、把房间调暗,基本可以消除背面内容;最糟的是盖着白色背景的盖子扫描,会增强背面反射。
nayuki查看英文原文
On the top image, I see that the back side of the page has clearly leaked through. In my experiences with scanning paper, I found a trick that essentially eliminates any visible backside content: Using a flatbed scanner, I would scan with the lid open, and the room darkened. The worst thing to do is to scan with the lid closed, with a lid that has a white background. This would increase the reflection from the backside of the page.
它只是基于像素的 k-means 聚类,不涉及符号识别,效果干净且避免了识别改字风险。
很高兴看到这里用了 k-means 聚类。我原本担心它会“聪明”到把内容转成符号,重演“施乐复印机会改数字”那类 bug,但它只是纯像素图像处理。结果很干净,某种程度上是更聪明的 posterize(色调分离)。
pjc50查看英文原文
Nice to see a bit of k-means clustering. I was worried that this might attempt to be "smart" by converting to symbols, replicating the "Xerox changes numbers in copied documents" bug, but it's pure pixel image processing. Very clean results. In some ways it's a smarter version of the "posterize" feature.
荧光笔高亮(尤其粉/黄)会被颜色聚类过滤掉,是方法的固有局限。
我发现它也很适合复印文档而不改变质量。关于笔记,有一件事困扰我:高亮文本。颜色很鲜明,却总被过滤掉;蓝绿荧光笔还好,粉色或黄色就另当别论了。这是方法本身固有的,据我所知(也试过),调整阈值也修不好。尽管如此仍是很好的工具,我已经把它自动化用于我每次扫描。
vajenetehais查看英文原文
I've found it really interesting and it works great to also copy documents without altering quality. About notes, there is one thing that bothers me. It's highlighted text. Colors are clear and are always filtered. Blue and green highlighter are ok, but pink or yellow ones are another story. That's inherent to the method used and as far I know (and tried) can't be fixed with adjusted thresholds. It's nonetheless a great tool and I've automated its use for every scan I do.
历次讨论
同类还值得读
直接在浏览器中启动 Linux 内核
Boot a linux kernel right inside your browser.
Fabrice Bellard 的 JSLinux 页面,用 JavaScript 在浏览器里启动一个 Linux 内核,并提供一个可交互的终端环境。
工具与资源上首页 5 次 · 2011–2025bellard.orgHacker News 未公开功能与行为清单(2018)
A List of Hacker News's Undocumented Features and Behaviors (2018)
数据科学家 Max Woolf 整理的 Hacker News 未公开功能与行为清单,涵盖投票机制、排名算法、账号惩罚等社区运作细节。
工具与资源上首页 5 次 · 2019–2025github.comMapSCII:在终端中用盲文和 ASCII 渲染地图
MapSCII – Braille and ASCII map renderer for the console
MapSCII 是一个在命令行终端里渲染地图的开源工具,用盲文字符和 ASCII 字符把地理数据画成可交互浏览的字符地图。
工具与资源上首页 5 次 · 2017–2025github.com顶尖大学的免费在线课程
Free Online Courses from Top Universities
Open Culture 整理的一份免费在线课程合集,汇集了全球顶尖大学(如 MIT、斯坦福、耶鲁等)向公众开放的网络课程资源,涵盖音频、视频等多种形式。
工具与资源上首页 5 次 · 2010–2022openculture.com淘气字符串:容易引发用户输入问题的字符串清单
Naughty Strings: A list of strings likely to cause issues as user-input data
一个 GitHub 仓库,收录了大量容易让程序出问题的用户输入字符串,如特殊字符、emoji、SQL 注入片段、系统命令等,供开发者用于测试输入处理逻辑。
工具与资源上首页 4 次 · 2015–2020github.com