将文本和图像放置到枕头图像对象上的工具。
iipp的Python项目详细描述
印刷机
将文本和图像放置到枕头图像对象上的工具。在
安装
可以使用以下命令通过PyPI安装PrintingPress:
pip3 install iipp
依赖性
PrintingPress使用枕头,官方支持的最低版本是7.0.0
。在
不保证7.0.0
下的枕头版本的兼容性,但您可以在安装时免费尝试使用--no deps。
变更日志
1.0.2
- 修复图像类型放置区域的单字文本拟合
1.0.1
- 在
固定枕头依赖版本
在 - 在
图像类型放置区域的PIL图像路径的修复处理
在 - 在
修复名为“.meta”的放置区域的处理
在
1.0.0
- 在
修复图像不透明度相关问题
在 - 在
在位置中添加适合文本的调整选项
在
使用
使用来自JSON文件的位置
^{pr2}$使用Python字典中的placements
fromPILimportImageimportPrintingPressplacements_py={"area0_image_test":{"type":"image","path":"/path/to/image.png","xy":[50,50],"wh":[400,400],},"area1_text_test":{"type":"text","path":"/path/to/bahnschrift.ttf","text":"Hello Image","xy":[50,50],"wh":[400,400],"font_size":8,"font_variant":"SemiBold Condensed","font_opacity":76,}}placements=PrintingPress.Placements.parse(placements_py)# Operate on target fileimage=Image.open('base_image.png').convert('RGBA')# conversion to RGBA is requiredoutput=PrintingPress.operate(image=Image.open('base_image.png'),placements=placements)# Save the output fileoutput.save('output.png')
许可证
PrintingPress是根据MIT许可证授权的。 (File/ OSI)
- 项目
标签: