Skip to main content

Pictomancer.ai

pictomancer

Image processing for AI agents.
Resize, compress, convert, crop & pipeline — sub-50 ms, pay-per-request.

PyPI Python API Docs x402


Thin async Python client for Pictomancer.ai — the image processing API built for autonomous agents. No API keys, no accounts. First 50 requests free, then micropayments via x402 (USDC on Base L2).

Install

pip install pictomancer

With LangChain support:

pip install pictomancer[langchain]

Quick start

import asyncio
from pictomancer import Pictomancer

async def main():
    async with Pictomancer() as p:
        # Free — get image metadata
        info = await p.analyze("https://example.com/photo.jpg")
        print(f"{info.size_bytes:,} bytes")

        # Resize to 50%
        data = await p.resize("https://example.com/photo.jpg", scale=0.5)

        # Compress to q=70 WebP
        data = await p.compress("https://example.com/photo.jpg", q=70, format="webp")

        # Convert PNG → WebP
        data = await p.convert("https://example.com/photo.png", format="webp")

        # Crop a region
        data = await p.crop("https://example.com/photo.jpg",
                            x=0, y=0, width=800, height=600)

asyncio.run(main())

Pipeline

Chain up to 10 operations in a single request:

from pictomancer import Pictomancer, PipelineOp

async with Pictomancer() as p:
    data = await p.pipeline("https://example.com/photo.jpg", [
        PipelineOp(type="resize",   params={"scale": "0.5"}),
        PipelineOp(type="compress", params={"q": "70"}),
        PipelineOp(type="convert",  params={"format": "webp"}),
    ])

Supported formats

Query at runtime with await p.info(), or see the full list:

Format Extensions Key options
JPEG .jpg q (1–100), strip, interlace
PNG .png compression (0–9), palette, strip
WebP .webp q (1–100), lossless, strip
TIFF .tiff compression (deflate, lzw, zstd…), q
GIF .gif dither (0–1), effort, bitdepth

LangChain

from pictomancer.langchain import pictomancer_tools

tools = pictomancer_tools()

# 5 tools: analyze, resize, compress, convert, crop
# Pass to any LangChain agent, LangGraph tool node, or chain

Each tool includes pricing in its description so cost-aware agents can make informed decisions.

x402 payments

The first 50 requests per agent are free. After that, agents pay automatically via x402 — USDC on Base L2.

Pass a wallet address for identity tracking:

async with Pictomancer(wallet="0xYourAgentWallet") as p:
    data = await p.resize("https://example.com/photo.jpg", scale=0.5)

Pricing

Operation Base cost What it does
analyze Free Image metadata (size in bytes)
resize $0.001 Scale by factor
compress $0.001 Re-encode with quality control
convert $0.002 Format conversion
crop $0.001 Extract rectangular region
pipeline Per-op Chain operations, volume discount at 3+

Size multipliers: <1 MB → 1×, 1–5 MB → 1.5×, 5–10 MB → 2×, 10–50 MB → 3×.

MCP

You can also connect directly to the hosted MCP server — no SDK needed:

{
  "mcpServers": {
    "pictomancer": {
      "url": "https://api.pictomancer.ai/mcp"
    }
  }
}

Works with Claude Desktop, Cursor, Windsurf, and any MCP-compatible client.

License

MIT

Metadata

Release files for pictomancer 0.1.0

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

Source distribution (sdist)

Source distribution for pictomancer 0.1.0
File Size Uploaded
pictomancer-0.1.0.tar.gz 8.2 kB Details

Built distribution (wheel)

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

Total release size: 15.5 kB

Release files / pictomancer-0.1.0.tar.gz

Download URL pictomancer-0.1.0.tar.gz
Size 8.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c45736c3ac0f58c2b63af900104f5cb22b5bcd0fd0b978bf805d32c84fa86343
BLAKE2b-256 checksum
How to use checksums
44e9875daf7e0055420c4fb808b6e23f8bc90e40ce5684afb49a592958444c90
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 28, 2026.

Transparency log

Release files / pictomancer-0.1.0-py3-none-any.whl

Download URL pictomancer-0.1.0-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c6e1007e390fb2c64361f8d2faac84af2f8105240934ab6d8f85789d153ea737
BLAKE2b-256 checksum
How to use checksums
44bff23be59b778758bdcb9370146038e4262c682bb067daec0e2c42c9cb45e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 28, 2026.

Transparency log

Release history Release notifications | RSS feed

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

This release

0.1.0 This release

2 release files

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