用于添加边框到我的摄影图片的Python工具
项目描述
colorframe
一个简单的包,用于在图片上添加彩色边框。
安装
此代码与所有当前支持的Python版本兼容。它可以在虚拟环境中安装
python -m pip install colorframe
使用
在此包安装在激活环境中后,可以通过python -m colorframe
调用。详细使用方法如下
Usage: python -m colorframe [OPTIONS] [PATH]
Add colored borders on pictures, easily.
╭─ Arguments ─────────────────────────────────────────────────────────────────────────────╮
│ path [PATH] Location, relative or absolute, to the file or directory of files │
│ to add a colored border to. │
│ [default: None] │
╰─────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ───────────────────────────────────────────────────────────────────────────────╮
│ --left INTEGER Width of the frame to add on the left image edge. │
│ [default: 0] │
│ --right INTEGER Width of the frame to add on the right image edge. │
│ [default: 0] │
│ --top INTEGER Height of the frame to add on the top image edge. │
│ [default: 0] │
│ --bottom INTEGER Height of the frame to add on the bottom image │
│ edge. │
│ [default: 0] │
│ --color TEXT The desired color of the added border. Should be a │
│ keyword recognized by Pillow. │
│ [default: white] │
│ --log-level TEXT The base console logging level. Can be 'debug', │
│ 'info', 'warning' and 'error'. │
│ [default: info] │
│ --install-completion Install completion for the current shell. │
│ --show-completion Show completion for the current shell, to copy it │
│ or customize the installation. │
│ --help Show this message and exit. │
╰─────────────────────────────────────────────────────────────────────────────────────────╯
脚本将遍历文件,添加边框,并将结果导出到新创建的outputs
文件夹中。
您还可以导入包中的高级对象,并按需使用。例如,要在文件夹中的所有图片的左侧添加150px的蓝色边框和底部添加72px的边框
from colorframe import BorderCreator
border_api = BorderCreator(
commandline_pathp="path/to/images/",
left_border=150,
bottom_border=72,
color="blue",
)
border_api.execute_target()
由fsoubelet用♥︎制作
MIT © 2020 Felix Soubelet
MIT © 2020 Felix Soubelet
项目详情
下载文件
下载适用于您的平台的文件。如果您不确定选择哪个,请了解有关安装软件包的更多信息。
源分发
colorframe-0.3.0.tar.gz (7.1 kB 查看哈希值)
构建分发包
colorframe-0.3.0-py3-none-any.whl (7.7 kB 查看哈希值)
关闭
colorframe-0.3.0.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | f9245b2ccdf86c9b75b185001f2920f4fba4e24a14cfb0ffe7f4466179c16722 |
|
MD5 | 1cdf02486b16f04022f527e2db4d6922 |
|
BLAKE2b-256 | 5834ea0875d7d987bd34b984bc45c6861aac2be34288a4b27bcd43f14a19d745 |
关闭
colorframe-0.3.0-py3-none-any.whl的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 145b27eaea98fce6c4b4cb22b29fc02080338b26ec690916525fadf904be060c |
|
MD5 | 310e334a9a1d3f425ebeb3b7d2ec5b96 |
|
BLAKE2b-256 | cade94981886584d30d89a737389e918cbb9454d42caa20d9054e6e0706fb6e5 |