npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-screenshot-diff

v0.1.1

Published

Pixel-diff two screenshots into diff.png + a labeled triptych (pixelmatch)

Readme

dsh-screenshot-diff

DeepSeek Harness 插件 · 像素对比 / DSH plugin for pixel-diffing screenshots

对两张已截图做像素 diff,输出 diff.png(差异标红)和 compare-triple.png(左 A / 中 B / 右 diff 三联图,各自左上角带标签)。不做截图采集——输入是你已有的两张图。

Pixel-diff two existing screenshots into diff.png (differences in red) plus a labeled triptych compare-triple.png (A | B | diff). It does not capture screenshots — you supply the two images.

使用 Usage

bash scripts/diff.sh /abs/path/imgA.png /abs/path/imgB.png \
  --label-a before \
  --label-b after \
  --sensitivity high \
  --out /tmp/diff-out

| 参数 | 说明 | |---|---| | --out DIR | 输出目录,默认第一张图所在目录 | | --label-a/--label-b TEXT | 左右图标签,默认 a / b | | --sensitivity LEVEL | normal(灰度+阈值0.1+忽略抗锯齿,稳)/ high(彩色+阈值0.02+计入抗锯齿)/ ultra(阈值0.01,最灵敏、噪点多) | | --threshold N | pixelmatch 阈值,显式传入覆盖灵敏度预设 | | --crop-top PX | 两图同时裁掉顶部物理像素 | | --compare-tool DIR | sharp/pngjs/pixelmatch 依赖目录,或设 COMPARE_TOOL_ENV |

依赖自动发现:--compare-tool > COMPARE_TOOL_ENV > 仓库内 scripts/compare-tool。依赖为 sharp / pngjs / pixelmatch

输出 Output

<out>/diff.png            差异标红([255,0,0])
<out>/compare-triple.png  三联图:左 A | 中 B | 右 diff <相似度>

stdout 输出 JSON:similaritynumDiffPixelstotalsensitivitythreshold

判读 Judgment

  • 相似度 ≠ 结论:90% 以上的"大体一致"也要人工看 diff 区是否集中在应改位置。
  • 先用 normal 跑一版;要抓淡灰/白渐变这类低对比差异再升 highultra 噪点最多,慎用。
  • 尺寸不一致直接失败,不会被拉伸掩盖布局问题——这是刻意设计。
  • 两张图必须同一视口/分辨率、同一页面状态(滚动位置、弹窗、加载态),否则 diff 无意义。

安装 Install

# 发布到 npm 后
dsh plugin --profile demo add dsh-screenshot-diff

# 或从 GitHub 安装
dsh plugin --profile demo add github:PangYiMing/dsh-screenshot-diff

许可证 License

MIT