{"id":18069753,"url":"https://github.com/hiroi-sora/umi-cut","last_synced_at":"2025-04-09T14:09:21.983Z","repository":{"id":37667536,"uuid":"481886655","full_name":"hiroi-sora/Umi-CUT","owner":"hiroi-sora","description":"图片批量去黑边/裁剪/压缩工具，带界面。可排除图片边缘的色块干扰，将黑边删除干净。基于 Opencv 。","archived":false,"fork":false,"pushed_at":"2023-03-03T18:21:18.000Z","size":103,"stargazers_count":304,"open_issues_count":8,"forks_count":29,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-02T06:59:55.239Z","etag":null,"topics":["gui","opencv","python","tkinter"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hiroi-sora.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":"2022-04-15T08:12:07.000Z","updated_at":"2025-03-30T06:15:07.000Z","dependencies_parsed_at":"2024-10-31T08:24:28.553Z","dependency_job_id":"9ee013a9-2e8c-4d77-81d4-bf8080efbb97","html_url":"https://github.com/hiroi-sora/Umi-CUT","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiroi-sora%2FUmi-CUT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiroi-sora%2FUmi-CUT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiroi-sora%2FUmi-CUT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hiroi-sora%2FUmi-CUT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hiroi-sora","download_url":"https://codeload.github.com/hiroi-sora/Umi-CUT/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248054195,"owners_count":21039952,"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":["gui","opencv","python","tkinter"],"created_at":"2024-10-31T08:22:39.274Z","updated_at":"2025-04-09T14:09:21.960Z","avatar_url":"https://github.com/hiroi-sora.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Umi-CUT 批量图片去黑边/裁剪/压缩软件\n\n批量处理图片文件，具有范围裁剪、自动去除黑/白边、调整大小、压缩体积等功能。\n\n![](https://tupian.li/images/2022/04/15/image.png)\n![](https://tupian.li/images/2022/04/15/image5f088a54bf9e3163.png)\n\n## 下载\n\n[Umi-CUT 批量图片转文字 v1.0.2](https://github.com/hiroi-sora/Umi-CUT/releases/tag/v1.0.2)\n\n## 系统支持\n\n- 源码可在绝大多数支持Python 3.x和Opencv的平台上跑起来。\n- 发行版exe程序：\n  - 支持 win10、win11。\n  - 支持 win7 x64 sp1 及以上版本。若您无法打开本软件，请检查是否已打系统补丁 KB2533623 、KB2999226 。\n\n## Umi-系列图片处理软件\n\n[Umi-OCR 批量图片转文字软件](https://github.com/hiroi-sora/Umi-OCR)\n\n**Umi-CUT 批量图片去黑边/裁剪/压缩软件 ◁**\n\n## 简介\n\n本软件能批量处理本地图片，具有范围裁剪、自动去除黑/白边、调整大小、压缩体积等功能。\n通过范围裁剪和去黑边两种功能配合，可以绕过图片边缘的干扰色块，提取图片中部的所需内容。\n\n\u003e 比如下图这张Ipad截图，底部带有小白条，普通去黑边工具无法很好的去除底部黑边。\n\u003e ![](https://s1.ax1x.com/2022/04/15/L8GDRP.png)\n\u003e \n\u003e 而 Umi-CUT 可以先设置手动范围，绕过小白条，再自动去除剩下的纯黑边框。只需设定一次，便可批量处理所有同类图片。这是开发本软件的初衷。\n\n\n## 使用说明\n\n### 准备\n\n发行包用户：下载压缩包并解压。\n\nPython用户：下载源码，安装好Opencv等所需模块。\n\n### 一键去除黑边\n\n1. 打开主程序，将任意 **图片/文件夹** 拖入窗口中的白色背景表格区域，或点击左上方的 **浏览** 选择图片。\n2. 点击右上方 **开始任务** ，等待进度条走完。\n   - 任务进行中，可随时点击 **终止任务**（原开始任务按钮）来停止，但下次开始时依然会从头开始。\n3. 在 **第一张图片的目录** 下的 `# 裁剪` 文件夹查看输出图片。\n\n![](https://s1.ax1x.com/2022/04/15/L8YDu8.png)\n\n### 其他参数设置\n\n点击 **设置** 选项卡，点击 **参数设置** 打开配置窗口。根据提示调整参数即可。\n- 红色框为手动裁剪的范围。虚线框是在手动裁剪基础上，自动去除剩下黑边的范围。\n- 可切换自动裁切边缘的颜色为黑色/白色。\n- 若待处理图片的黑边中含有少量杂色、噪点，调高`中值滤波`参数。（但滤波值太高可能导致留下很窄的黑边）\n- 若待处理图片的黑边不是纯“黑”，调高`阈值`参数。（但阈值太高可能导致需要保留的部分也被裁剪）\n\n![](https://tupian.li/images/2022/04/15/imagef816383a8800731b.png)\n\n## 测试\n\n输入100张2k分辨率图片。\n\n输出为png图片时，平均每张0.5s。\n\n输出为jpg图片时，平均每张0.2s。\n\n## 开发说明\n\n- 在**参数配置窗口**加载预览图片时，若采用“拖入”的方法，对于D3色域的图片可能导致程序崩溃：\n    ```\n    Fatal Python error: \n    PyEval_RestoreThread: NULL tstate       \n    Python runtime state: initialized\n    ```\n  这个崩溃貌似由opencv引起，但触发在tkinter的事件循环中(执行完业务函数以后)，所以没有办法捕捉到。采用点击左上角按钮加载预览图片则没有这个问题。对于普通sRGB图片，貌似两种方法加载预览都不会有事。保险起见，不建议使用拖入的方式加载预览。\n  - 注，以上“拖入”指在参数配置的辅窗口。在批量处理的主界面直接拖入文件是没有半点问题的。\n- 使用`pyinstaller`打包，可使用 `to_exe.py` 一键打包。\n\n## 更新日志\n\n##### v1.0.2 `2022.10.17`\n\n- 新功能：自动裁切边缘颜色可切换黑边/白边。\n- 修复了漏洞：手动裁剪数值不合法时的异常。\n\n##### v1.0.1 `2022.4.19`\n\n- 修复了漏洞：手动裁剪与去黑边同时进行时可能发生错位偏移。\n\n##### v1.0.0 `2022.4.15`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhiroi-sora%2Fumi-cut","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhiroi-sora%2Fumi-cut","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhiroi-sora%2Fumi-cut/lists"}