{"id":20839288,"url":"https://github.com/ailln/img2img","last_synced_at":"2025-08-11T23:06:45.346Z","repository":{"id":62570631,"uuid":"183926496","full_name":"Ailln/img2img","owner":"Ailln","description":"🔮 快速转化图片格式","archived":false,"fork":false,"pushed_at":"2020-07-30T13:47:17.000Z","size":272,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-11T18:46:48.932Z","etag":null,"topics":["image2image","img2img","jpg2ico","jpg2png","png2ico"],"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/Ailln.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}},"created_at":"2019-04-28T15:33:50.000Z","updated_at":"2024-03-25T11:19:54.000Z","dependencies_parsed_at":"2022-11-03T17:15:33.435Z","dependency_job_id":null,"html_url":"https://github.com/Ailln/img2img","commit_stats":null,"previous_names":["havetwobrush/img2img"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Ailln/img2img","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ailln%2Fimg2img","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ailln%2Fimg2img/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ailln%2Fimg2img/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ailln%2Fimg2img/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ailln","download_url":"https://codeload.github.com/Ailln/img2img/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ailln%2Fimg2img/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269970120,"owners_count":24505466,"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","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["image2image","img2img","jpg2ico","jpg2png","png2ico"],"created_at":"2024-11-18T01:13:11.681Z","updated_at":"2025-08-11T23:06:45.324Z","avatar_url":"https://github.com/Ailln.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# img2img: Image to Image\n\n🔮快速转化图片格式\n\n[![](https://award.dovolopor.com?lt=language\u0026rt=Py36\u0026rbc=pink)](https://docs.python.org/3.6/)\n[![](https://award.dovolopor.com?lt=PyPI\u0026rt=0.1.2)](https://pypi.org/project/img2img/)\n[![](https://award.dovolopor.com?lt=Ailln's\u0026rt=idea\u0026lbc=lightgray\u0026rbc=red\u0026ltc=red)](https://github.com/Ailln/award)\n\n\u003e **🚨更新日志：**\n\u003e\n\u003e - `v0.0.1` 初始化项目，添加在命令行使用 jpg2png 方法；\n\u003e - `v0.1.0` 添加常见的 6 种转化方法；\n\u003e - `v0.1.1` 修复版本错误问题；\n\u003e - `v0.1.2` 回保存图片的路径；\n\u003e - `v0.2.0` 支持命令行批量转化。\n\n## 1 功能\n\n1. 支持 **6 种**常见图片格式转化；\n2. 支持在**命令行**调用；\n3. 支持在[**网页上**](https://www.dovolopor.com/img2img)使用。\n\n![](./src/img2img-site.png)\n🔗[点我访问](https://www.dovolopor.com/img2img)\n\n## 2 安装\n\n### 2.1 使用 pip 安装\n\n```shell\npip install img2img\n```\n\n### 2.2 从代码库安装\n\n```shell\ngit clone https://github.com/Ailln/img2img.git\ncd img2img\npython setup.py install\n```\n\n## 3 使用\n\n目前总共支持6种方法，如下：\n\n1. jpg2png\n2. png2jpg\n3. jpg2ico\n4. ico2jpg\n5. png2ico\n6. ico2png\n\n下文中使用 `jpg2png` 作为演示，其他方法同理。\n\n### 3.1 在代码中调用\n\n```python\n# 在文件首部引入包\nimport img2img\n\n# 查看版本\nimg2img.__version__\n# output: 0.2.0\n\nimg = img2img.Img2img()\n\n# 默认输出路径和输入路径相同\nimg.convert(\"jpg2png\", \"./test.jpg\")\n\n# 支持手动修改输出路径\nimg.convert(\"jpg2png\", \"./test.jpg\", \"../new_test.png\")\n```\n\n### 3.2 在命令行中使用\n\n```bash\n# 默认输出路径和输入路径相同\njpg2png ./test.jpg\n\n# 支持手动修改输出路径\njpg2png ./test.jpg ../new_test.png\n\n# 支持文件夹批量转化\njpg2png ./test/\n```\n\n## 4 版本支持\n\n- 理论上支持 `Windows`、`MacOS`、`Ubuntu` 下的所有 `Python 3.6` 的版本。\n- 实际上仅在 `Windows 10`、`MacOS 10.14`、`Ubuntu 16.04` 的 `Python 3.6.3` 上做过完整测试。\n- 欢迎提交其他版本使用情况到 [Issues](https://github.com/Ailln/img2img/issues) 中，期待你的反馈。\n- 如果你有 `Python 2` 的使用需求，可 Fork 代码自行修改。当然也欢迎提 PR，贡献自己代码给其他人。\n\n## 5 协议\n\n[![](https://award.dovolopor.com?lt=License\u0026rt=MIT\u0026rbc=green)](./LICENSE)\n\n## 6 参考\n\n- [如何发布自己的包到 pypi ？](https://www.v2ai.cn/python/2018/07/30/PY-1.html)\n- [python 中的小陷阱](https://www.v2ai.cn/python/2019/01/01/PY-6.html)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Failln%2Fimg2img","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Failln%2Fimg2img","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Failln%2Fimg2img/lists"}