Skip to content

Widecss/pyquadim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pyquadim

CI PyPI version

简单移植 quadim 到 Python 中。(用于 qq bot 的涩图防和谐

安装

使用 pip

pip install pyquadim

编译安装(需要 Rust 环境)

pip install -r requirements.txt

# 直接安装
python setup.py install

# 或者打包 wheel
python setup.py sdist bdist_wheel

用法

from PIL import Image
import pyquadim

img = Image.open("./test.jpg")
img = img.convert("RGBA")  # Quadim 项目目前仅支持 RGBA

w, h = img.size
data = img.getdata()

result = pyquadim.render(data, w, h, shape="yr-add", thres_ay=10, stroke_width=6)

img.putdata(result)
img.show()

致谢

About

Implementation of quadim in Python

Resources

Stars

Watchers

Forks

Packages

No packages published