{"id":18756926,"url":"https://github.com/aiursoftweb/nibot","last_synced_at":"2025-04-13T02:06:40.258Z","repository":{"id":246333731,"uuid":"820556273","full_name":"AiursoftWeb/NiBot","owner":"AiursoftWeb","description":"A cli tool helps you to de-duplicate images in a folder.","archived":false,"fork":false,"pushed_at":"2024-09-12T07:01:01.000Z","size":1548,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-09-12T16:51:43.119Z","etag":null,"topics":["deduplication","dotnet","image-processing","tool"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AiursoftWeb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-26T17:52:11.000Z","updated_at":"2024-09-12T07:01:06.000Z","dependencies_parsed_at":"2024-06-27T08:23:15.079Z","dependency_job_id":"ef54b678-b994-4d7f-9cb2-9b5082f18f97","html_url":"https://github.com/AiursoftWeb/NiBot","commit_stats":null,"previous_names":["aiursoftweb/nibot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AiursoftWeb%2FNiBot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AiursoftWeb%2FNiBot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AiursoftWeb%2FNiBot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AiursoftWeb%2FNiBot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AiursoftWeb","download_url":"https://codeload.github.com/AiursoftWeb/NiBot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223560666,"owners_count":17165505,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deduplication","dotnet","image-processing","tool"],"created_at":"2024-11-07T17:38:43.845Z","updated_at":"2025-04-13T02:06:40.248Z","avatar_url":"https://github.com/AiursoftWeb.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NiBot\n\n[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://gitlab.aiursoft.cn/aiursoft/NiBot/-/blob/master/LICENSE)\n[![Pipeline stat](https://gitlab.aiursoft.cn/aiursoft/NiBot/badges/master/pipeline.svg)](https://gitlab.aiursoft.cn/aiursoft/NiBot/-/pipelines)\n[![Test Coverage](https://gitlab.aiursoft.cn/aiursoft/NiBot/badges/master/coverage.svg)](https://gitlab.aiursoft.cn/aiursoft/NiBot/-/pipelines)\n[![NuGet version](https://img.shields.io/nuget/v/Aiursoft.NiBot.svg)](https://www.nuget.org/packages/Aiursoft.NiBot/)\n[![ManHours](https://manhours.aiursoft.cn/r/gitlab.aiursoft.cn/aiursoft/nibot.svg)](https://gitlab.aiursoft.cn/aiursoft/nibot/-/commits/master?ref_type=heads)\n\nA cli tool helps you to de-duplicate images in a folder.\n\nSuppose you enjoy collecting images and intensively gather a large number of them from various websites to your hard drive every day. Soon, your hard drive accumulates tens of thousands of CG images with different sources and resolutions.\n\nHowever, you discover that a significant portion of these downloaded CG images are duplicates, occupying precious disk space. Therefore, you urgently need a fast method to identify and remove duplicates from your CG directory. Since the sources of these downloads vary, traditional methods such as searching by file names are clearly inadequate for solving this problem; it's necessary to analyze the content of the images.\n\n## Installation\n\nRequirements:\n\n1. [.NET 9 SDK](http://dot.net/)\n\nRun the following command to install this tool:\n\n```bash\ndotnet tool install --global Aiursoft.NiBot\n```\n\n## Usage\n\nAfter getting the binary, run it directly in the terminal.\n\n```bash\n$ nibot dedup\nOption '--path' is required.\n\nDescription:\n  De-duplicate images in a folder.\n\nUsage:\n  nibot dedup [options]\n\nOptions:\n  -p, --path \u003cpath\u003e (REQUIRED)                  Path of the folder to dedup.\n  -ds, --duplicate-similar \u003cduplicate-similar\u003e  Similarity bar. This value means two image are considered as duplicates if their similarity is greater than it. Setting too small may cause different images to be considered as \n                                                duplicates. Suggested values: [96-100] [default: 96]\n  -r, --recursive                               Recursively search for similar images in subdirectories. [default: False]\n  -k, --keep \u003ckeep\u003e                             Preference for sorting images by quality to determine which to keep when duplicates are found. Available options: \n                                                Colorful|GrayScale|Newest|Oldest|Smallest|Largest|HighestResolution|LowestResolution. [default: Colorful|HighestResolution|Largest|Newest]\n  -a, --action \u003cDelete|MoveToTrash|Nothing\u003e     Action to take when duplicates are found. Available options: Nothing, Delete, MoveToTrash. [default: MoveToTrash]\n  -y, --yes                                     No interactive mode. Taking action without asking for confirmation. [default: False]\n  -e, --extensions \u003cextensions\u003e                 Extensions of files to dedup. [default: jpg|jpeg|png|jfif]\n  -t, --threads \u003cthreads\u003e                       Number of threads to use for image indexing. Default is 32. [default: 32]\n  -v, --verbose                                 Show detailed log\n  -?, -h, --help                                Show help and usage information\n```\n\nIt will fetch all images in the folder and compare them with each other. If two images are similar enough, it will consider them as duplicates. \n\nIt will pick the best one based the `--keep` option. If the `--action` is set to `Delete`, it will delete the rest of the duplicates. If the `--action` is set to `MoveToTrash`, it will move the rest of the duplicates to the trash.\n\nWith the `--interactive` option, it will preview each photo and ask for confirmation before deleting files.\n\n## Install as a Class Library\n\nYou can also install this tool as a class library. \n\n```bash\ndotnet add package Aiursoft.NiBot.Core\n```\n\nThen you can use the `DedupEngine` class to de-duplicate images in your own code.\n\n```csharp\n    services.AddLogging(builder =\u003e\n    {\n        builder.AddConsole();\n        builder.AddDebug();\n    });\n    services.AddTransient\u003cDedupEngine\u003e();\n    services.AddTransient\u003cImageHasher\u003e();\n    services.AddTransient\u003cBestPhotoSelector\u003e();\n    services.AddTransient\u003cFilesHelper\u003e();\n    services.AddTaskCanon();\n    var sp = services.BuildServiceProvider();\n    var dedupEngine = sp.GetRequiredService\u003cDedupEngine\u003e();\n```\n\nThat's it!\n\n## Run locally\n\nRequirements about how to run\n\n1. [.NET 9 SDK](http://dot.net/)\n2. Execute `dotnet run` to run the app\n\n## Run in Microsoft Visual Studio\n\n1. Open the `.sln` file in the project path.\n2. Press `F5`.\n\n## How to contribute\n\nThere are many ways to contribute to the project: logging bugs, submitting pull requests, reporting issues, and creating suggestions.\n\nEven if you with push rights on the repository, you should create a personal fork and create feature branches there when you need them. This keeps the main repository clean and your workflow cruft out of sight.\n\nWe're also interested in your feedback on the future of this project. You can submit a suggestion or feature request through the issue tracker. To make this process more effective, we're asking that these include more information to help define them more clearly.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faiursoftweb%2Fnibot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faiursoftweb%2Fnibot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faiursoftweb%2Fnibot/lists"}