使用 Pillow 生成 PJSekai 背景
项目描述
pjsekai_background_gen_pillow
从 Image 生成 PJSekai 背景图像。
安装
pip install pjsekai_background_gen_pillow
例子
from PIL import Image
import pjsekai_background_gen_pillow as pjbg
generator = pjbg.Generator()
generator.generate(Image.open("path/to/image.png")).save("path/to/output.png")
命令行界面
您可以运行pjsekai_background_gen_pillow,pjbg或python -m pjsekai_background_gen_pillow从命令行运行。
usage: pjsekai_background_gen_pillow [-h] [-b BACKGROUND] [-f FORMAT] base output
Generates PJSekai background image from Image.
positional arguments:
base Base image file path, or "-" for stdin.
output Output image file path, or "-" for stdout.
optional arguments:
-h, --help show this help message and exit
-b BACKGROUND, --background BACKGROUND
Background image file path.
-f FORMAT, --format FORMAT
Output image format.
API
Generator
背景图像的生成器。
参数
基础:PIL.Image
基本背景图像。默认为内置背景图像。
.generate(image)
从源图像生成背景图像。
参数
来源:PIL.Image
源图像。
退货
PIL.图像
执照
该库在 GPLv3 下获得许可。test.png在 CC-BY-SA 4.0 下获得许可。
项目详情
关
pjsekai_background_gen_pillow -0.3.0.tar.gz 的哈希值
| 算法 | 哈希摘要 | |
|---|---|---|
| SHA256 | 268bf70193016837d5cbf5288fc990d3ec9ba5299b241288bda20622cc3eeb87 |
|
| MD5 | 17321bc84fea6d05a02e410525394e01 |
|
| 布莱克2-256 | 189da9a3ad60164688a1535f2f2b66f96ba25daa7196db25524e7a76c0081c6c |
关
pjsekai_background_gen_pillow -0.3.0-py3-none-any.whl 的哈希值
| 算法 | 哈希摘要 | |
|---|---|---|
| SHA256 | bc8e04e3bb5d8a95508f08107b71c0f8490cb2102d9171874d858b1c557d2c0a |
|
| MD5 | de1e5a2ed7e4bcc8405565d329908255 |
|
| 布莱克2-256 | 9a43c146c98a66698b1c8ddbb028a99dafeee8d857ab64282e87174fa356659f |