Skip to main content

Pynter

Latest PyPI version

Minimal utility for generating images with textual caption

Usage

  1. Download an image

    curl https://i.imgur.com/XQCKcC9.jpg -o ./image.jpg

  2. Download a font

    curl https://fonts.google.com/download?family=Roboto -o ./roboto.zip ; unzip ./roboto.zip -d ./Roboto

  3. Provide a caption and Generate the image:

    from pynter.pynter import generate_captioned
    font_path = './Roboto/Roboto-Regular.ttf'
    image_path = './image.jpg'
    im = generate_captioned('China lands rover on Mars'.upper(), image_path=image_path, size=(1080, 1350),
                            font_path=font_path, filter_color=(0, 0, 0, 40))
    im.show()
    im.convert('RGB').save('drawn_image.jpg')

Results will look like:

https://i.imgur.com/fS6vPNm.jpg

Image Generation

generate_captioned( text: str,

image_path, size: Optional[Tuple[int, int]] = None, font_path: str = None, text_align: TextAlign = TextAlign.LEFT, bottom_margin: Optional[float] = 0.07, top_margin: Optional[float] = None, left_margin: float = 0.2, right_margin: float = 0.2, character_ratio: float = 0.07, filter_color: Tuple[int, int, int, int] = (0, 0, 0, 0), text_background_color: Tuple[int, int, int, int] = (0, 0, 0, 180), text_background_padding: float = 0.2, text_background_mode: TextBackgroundMode = TextBackgroundMode.STRIPE, filters: [BuiltinFilter] = [], color: Tuple[int, int, int, int] = (255, 255, 255, 255)) -> Image:

Installation

pip install pynter

Metadata

Release files for pynter 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pynter 0.1.6
File Size Uploaded Provenance Actions
pynter-0.1.6.tar.gz 5.2 kB Without provenance Details for pynter-0.1.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pynter 0.1.6
File Interpreter ABI Platform Actions
pynter-0.1.6-py3-none-any.whl Python 3 none any Details for pynter-0.1.6-py3-none-any.whl

Total release size: 10.9 kB

Release files / pynter-0.1.6.tar.gz

Download URL pynter-0.1.6.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5779e4352f74eeb7e3502406039be96e81e4986f44af6682e7968e9e6ea88f1e
BLAKE2b-256 checksum
How to use checksums
1bbcc2b682785fd1ebad68485912a3c1b1783277aee4b5811b9e6c6dc0ca0137
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

Release files / pynter-0.1.6-py3-none-any.whl

Download URL pynter-0.1.6-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
553a2a3fa1e06af73c1ec9064440ea507dfb6f5fbf5c27e854c8ce9c4140147b
BLAKE2b-256 checksum
How to use checksums
83c3f4c9cc0dcf17688d18f3197e2131dad116af333ec4f18b4d56da93bbe139
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

Security for pynter 0.1.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page