img2img: Image to Image
🔮快速转化图片格式
🚨更新日志:
v0.0.1初始化项目,添加在命令行使用 jpg2png 方法;v0.1.0添加常见的 6 种转化方法;v0.1.1修复版本错误问题;v0.1.2回保存图片的路径;v0.2.0支持命令行批量转化。
1 功能
- 支持 6 种常见图片格式转化;
- 支持在命令行调用;
- 支持在网页上使用。
🔗点我访问
2 安装
2.1 使用 pip 安装
pip install img2img
2.2 从代码库安装
git clone https://github.com/Ailln/img2img.git
cd img2img
python setup.py install
3 使用
目前总共支持6种方法,如下:
- jpg2png
- png2jpg
- jpg2ico
- ico2jpg
- png2ico
- ico2png
下文中使用 jpg2png 作为演示,其他方法同理。
3.1 在代码中调用
# 在文件首部引入包
import img2img
# 查看版本
img2img.__version__
# output: 0.2.0
img = img2img.Img2img()
# 默认输出路径和输入路径相同
img.convert("jpg2png", "./test.jpg")
# 支持手动修改输出路径
img.convert("jpg2png", "./test.jpg", "../new_test.png")
3.2 在命令行中使用
# 默认输出路径和输入路径相同
jpg2png ./test.jpg
# 支持手动修改输出路径
jpg2png ./test.jpg ../new_test.png
# 支持文件夹批量转化
jpg2png ./test/
4 版本支持
- 理论上支持
Windows、MacOS、Ubuntu下的所有Python 3.6的版本。 - 实际上仅在
Windows 10、MacOS 10.14、Ubuntu 16.04的Python 3.6.3上做过完整测试。 - 欢迎提交其他版本使用情况到 Issues 中,期待你的反馈。
- 如果你有
Python 2的使用需求,可 Fork 代码自行修改。当然也欢迎提 PR,贡献自己代码给其他人。
5 协议
6 参考
Metadata
Release files for img2img 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| img2img-0.2.0.tar.gz | 58.3 kB | Without provenance | Details for img2img-0.2.0.tar.gz |
Release files / img2img-0.2.0.tar.gz
| Download URL | img2img-0.2.0.tar.gz |
|---|---|
| Size | 58.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c1565a35186110342461c670ef76cde9c1370909f2e078697b3c4fa549139ec8
|
|
BLAKE2b-256 checksum How to use checksums |
d968bcd3c91ac30891d308fb76abdad3aee3c15fd0d989632730ee94f61d36e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
|
Security for img2img 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.