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

@kimi-tools/picture

v1.2.7

Published

A CLI tool to find and remove duplicate images

Readme

Kimi Picture Deduplicator

Kimi Picture Deduplicator 是一个智能的图片去重工具,可以帮助你快速识别并安全地移除重复的图片文件。

功能特性

  • 🔄 智能重复检测:基于图像内容而非文件名来检测重复图片
  • 🛡️ 安全删除流程:将重复文件移动到 "delete" 文件夹而不是直接删除
  • 📁 条件性删除文件夹:仅在发现重复文件时创建 "delete" 文件夹
  • 📂 深度遍历:支持递归扫描子目录中的所有图片文件
  • 🗂️ 拍平文件夹结构:将深层目录结构中的文件整理到统一目录
  • 🧹 空文件夹清理:自动清理处理后留下的空目录
  • 高性能处理:通过缩略图处理加速重复检测过程
  • 🖼️ 多格式支持:支持 JPG, PNG, GIF, BMP, TIFF, WebP 等常见图片格式
  • 智能重命名:支持按时间戳或随机数重命名图片文件

安装要求

在使用之前,请确保已安装以下依赖:

系统依赖

  • libvips: 高性能图片处理库

在 macOS 上安装 libvips:

brew install vips

在 Ubuntu/Debian 上安装 libvips:

sudo apt-get install libvips-dev

Node.js 依赖

npm install

使用方法

命令行使用

# 基本使用 - 扫描当前目录
kimi-pic repeat

# 深度遍历模式 - 递归扫描所有子目录
kimi-pic repeat -d

# 拍平文件夹结构 - 将子目录中的文件移到顶层并保持唯一性
kimi-pic flat

# 显示版本号
kimi-pic version

# 按随机数重命名当前目录中的图片
kimi-pic rename -r

# 按时间戳重命名当前目录中的图片(无时间信息时使用随机数)
kimi-pic rename -t

开发模式运行

# 克隆项目后,进入 picture 目录
cd packages/picture

# 运行命令
node bin/pic.js repeat

参数说明

| 参数 | 别名 | 描述 | |------|------|------| | --deep | -d | 深度遍历文件夹,递归扫描所有子目录 |

命令说明

| 命令 | 描述 | |------|------| | repeat | 查找并移动重复图片 | | flat | 将所有图片移动到当前目录 | | version | 显示版本号 | | rename | 重命名当前目录中的图片文件 | | rename -r | 使用10位随机数重命名当前目录中的所有图片 | | rename -t | 使用图片创建时间重命名当前目录中的所有图片(无时间信息时使用随机数) |

工作原理

  1. 扫描阶段:遍历指定目录中的所有文件,识别图片文件
  2. 处理阶段:为每张图片生成内容哈希值(基于缩略图)
  3. 比较阶段:比较哈希值以识别重复图片
  4. 移动阶段:将重复文件移动到 "delete" 文件夹
  5. 清理阶段:根据选项清理空目录

安全机制

  • 非破坏性操作:始终将文件移动到 "delete" 文件夹而非直接删除
  • 条件性创建:"delete" 文件夹仅在发现重复文件时创建
  • 用户确认:需要用户手动确认后才能永久删除文件
  • 进度显示:实时显示处理进度和统计信息

输出示例

正在扫描目录: /path/to/your/photos
目录中共有 1250 个文件:
  ├─ 图片文件: 1200
  └─ 非图片文件: 50

[██████████████████████████████████████████████████] 100% (1200/1200)

处理完成!
=== 处理统计 ===
总文件数: 1250
图片文件: 1200
非图片文件: 50
重复文件: 150

已移动的文件:
1. IMG_0001.jpg (哈希: a1b2c3d4e5f6...)
2. DSC_0001.jpg (哈希: a1b2c3d4e5f6...)
...

请检查 "delete" 文件夹中的文件,确认无误后可手动删除它们。

注意事项

  1. 工具只会处理支持的图片格式文件
  2. 对于损坏或无法读取的图片文件会跳过并显示错误信息
  3. 拍平模式下,来自不同子目录的同名文件会被自动重命名
  4. 处理大量文件时可能需要一些时间,请耐心等待

贡献

欢迎提交 Issue 和 Pull Request 来改进这个工具。