Generation and Watermarking

The Image Toolkit also includes generators for common product, marketing, and automation workflows.

Generation endpoints

Endpoint Purpose
POST /v1/image/placeholder Generate placeholder images
GET /v1/image/placeholder Return raw placeholder image bytes
POST /v1/image/qr Generate QR codes
GET /v1/image/qr Return raw QR code bytes
POST /v1/image/barcode Generate barcodes
GET /v1/image/barcode Return raw barcode bytes
POST /v1/image/watermark/text Add a text watermark
POST /v1/image/watermark/image Add a logo or image watermark
POST /v1/image/from-template Render a Liquid template as an image

Example social card workflow

from toolkitapi import Image

with Image(api_key="tk_...") as image:
    result = image.from_template(
        template="<html><body><h1>{{ heading }}</h1></body></html>",
        variables={"heading": "Toolkit API"},
        width=1200,
        height=630,
        dark_mode=True,
        format="png",
    )
    print(result["rendered_html_length"])