使用枕头创建社交网络片段的简单图像包。可以插入片段的图片,以便在社交网络中共享页面,例如在标签Meta:

snippet-image的Python项目详细描述


用于使用pillow为社交网络简单创建片段图像的包。

可插入片段图片以在社交网络中共享页面,例如在标记meta:

<metaproperty="og:image"content="Link to your snippet image"/><metaname="twitter:image"content="Link to your snippet image"/>

安装

pip3安装代码段映像

用户指南

要开始为片段创建图像,只需导入函数`from snippet_image import create_snippet_image`

fromsnippet_imageimportcreate_snippet_imageimage_blob=create_snippet_image(font='/home/iamterminator/.fonts/OpenSans-Bold.ttf',# Path to your font filefont_size=62,# Font sizebackground='/home/iamterminator/.wallpapers/jakethedog.jpg',# Path to your background imagesize=(1200,630),# Size of snippet image. (width, height)text='Jake the Dog',# Text for draw on snippet imagebrightness=0.3,# Brightness of background)withopen('jake-the-dog-snippet-image.jpg','wb')asfile:file.write(image_blob.getvalue())

集成

姜戈:django-snippet-image

摇尾巴:wagtail-snippet-image

阅读有关home的更多信息。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Eclipse内存分析器(MAT):不显示当前正在运行的进程   java Apache Velocity:转义字符不能作为关联数组键用于PHP   不截断零的java格式十进制输出   在另一个类文件中调用时返回空值的java getter   java集合获取连接   java解析json使用Gson登录系统应用程序强制关闭   java DelferredResult带有两个请求的ajax请求   java可降低功耗,同时应使用无线   java BoxLayout无法共享错误?   java如何使用计时器制作闹钟   java使用OAuth2保护RESTWeb服务:一般原则   java在一个jframe上显示多个图像和按钮