Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Package for simple creation images of snippets for social networks using pillow. Pictures for snippets can be inserted for sharing pages in social networks, for example in tag meta:

Project description

Package for simple creation images of snippets for social networks using pillow.

Pictures for snippets can be inserted for sharing pages in social networks, for example in tag meta:

<meta property="og:image" content="Link to your snippet image" />
<meta name="twitter:image" content="Link to your snippet image" />

Installation

pip3 install snippet-image

User guide

To start creating images for snippets, it is enough to import the function `from snippet_image import create_snippet_image`.

from snippet_image import create_snippet_image

image_blob = create_snippet_image(
        font='/home/iamterminator/.fonts/OpenSans-Bold.ttf', # Path to your font file
        font_size=62, # Font size
        background='/home/iamterminator/.wallpapers/jakethedog.jpg', # Path to your background image
        size=(1200, 630), # Size of snippet image. (width, height)
        text='Jake the Dog', # Text for draw on snippet image
        brightness=0.3, # Brightness of background
    )

with open('jake-the-dog-snippet-image.jpg', 'wb') as file:
    file.write(image_blob.getvalue())

Integration

Django: django-snippet-image.

Wagtail: wagtail-snippet-image.

Read more on home.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for snippet-image, version 0.1.7
Filename, size File type Python version Upload date Hashes
Filename, size snippet_image-0.1.7-py3-none-any.whl (5.4 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size snippet-image-0.1.7.tar.gz (4.7 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page