pictex
A Python library for efficient image generation using CSS Flexbox.
Decision gist · record as of 2026-08-14
Yes, if you need programmatic image generation with CSS-like layout control and don't want browser overhead. The library is actively maintained, has no known vulnerabilities, uses a permissive license, and supports modern Python versions. Install friction is low. The main caveat: skia-python and uharfbuzz are compiled dependencies; verify prebuilt wheels are available for your platform before committing to the stack.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later; skia-python and uharfbuzz are compiled dependencies that may require build tools on some systems.
- Low friction: pure Python wheel with no compiled system dependencies beyond the runtime stack (skia-python, uharfbuzz).
- Active maintenance with last commit 2026-04-03 and 210 repository stars.
License · maintenance · safety
permissive license (permissive) — MIT license (permissive): you can use, modify, and distribute PicTex freely in commercial and open-source projects with minimal restrictions.
last release 2026-04-03 (133 days) · last repo commit 2026-04-03 · 210 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 84,165 downloads/mo, #14,022 on PyPI
Alternatives
Verify before relying
pip install pictex
from pictex import Canvas, LinearGradient
canvas = Canvas().font_size(60).color("white").background_color(LinearGradient(["#2C3E50", "#FD746C"]))
image = canvas.render("Hello, World!")
image.save("output.png")- Whether skia-python and uharfbuzz prebuilt wheels are available for all major platforms (Windows, macOS, Linux) without requiring compilation.
- Performance characteristics and memory footprint when rendering large or complex layouts.
- Exact SVG export capabilities and whether font embedding works reliably across all font types.
What it is and what it does
PicTex is a Python library that generates images by composing layout elements (Row, Column, Text, Image) using CSS Flexbox principles. You describe your visual design using familiar web layout properties like justify-content, align-items, and flex-grow, then render the result as a raster or vector image. It handles typography through HarfBuzz (supporting kerning, ligatures, and complex scripts), bidirectional text, gradients, shadows, and rounded borders—all without needing a browser or headless rendering infrastructure.
The library is built on industry-standard graphics engines: Skia for rendering, Taffy for layout computation, and HarfBuzz for text shaping. It's designed for automated image generation workflows like Open Graph previews, social media cards, video thumbnails, data visualizations, and report generation. If you know CSS, the API is intuitive; if you don't, the fluent method-chaining style makes styling declarative and readable.
Use it for
- Generate Open Graph and social media preview images dynamically from metadata or API responses.
- Create styled code snippet images for tutorials, documentation, or social sharing.
- Build data visualization graphics (tables, charts) as PNG/SVG without a web rendering layer.
- Automate profile cards, GitHub repository cards, or tweet-like social graphics from structured data.
- Render multilingual or emoji-heavy text as images with proper shaping and bidirectional layout.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need programmatic image generation with CSS-like layout control and don't want browser overhead.
The library is actively maintained, has no known vulnerabilities, uses a permissive license, and supports modern Python versions. Install friction is low. The main caveat: skia-python and uharfbuzz are compiled dependencies; verify prebuilt wheels are available for your platform before committing to the stack.
Install
pictex on PyPI
Before you install
Low friction: pure Python wheel with no compiled system dependencies beyond the runtime stack (skia-python, uharfbuzz). Active maintenance with last commit 2026-04-03 and 210 repository stars. Supports Python 3.9 through 3.13.
Requires Python 3.9 or later; skia-python and uharfbuzz are compiled dependencies that may require build tools on some systems.
License in practice
MIT license (permissive): you can use, modify, and distribute PicTex freely in commercial and open-source projects with minimal restrictions.
Quickstart
pip install pictex
from pictex import Canvas, LinearGradient
canvas = Canvas().font_size(60).color("white").background_color(LinearGradient(["#2C3E50", "#FD746C"]))
image = canvas.render("Hello, World!")
image.save("output.png")
Verify before relying
- Whether skia-python and uharfbuzz prebuilt wheels are available for all major platforms (Windows, macOS, Linux) without requiring compilation.
- Performance characteristics and memory footprint when rendering large or complex layouts.
- Exact SVG export capabilities and whether font embedding works reliably across all font types.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 7 packagesimportlib-resourcespython-bidiregexskia-pythonstretchabletyping-extensionsuharfbuzz |
| Maintenance | Actively maintained 133 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 84,165 / month, #14,022 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Multimedia :: GraphicsTopic :: Scientific/Engineering :: VisualizationTopic :: Software Development :: Libraries :: Python ModulesTopic :: Text Processing :: FontsTyping :: Typed |
Evidence: pictex-2.3.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “css flexbox image generation”
- pictexPicTex generates high-quality PNG, JPEG, WebP, and SVG images…
- stretchablestretchable is a Python layout engine that implements CSS Block,…
- html2imageGenerates PNG/image files from HTML, CSS, and URLs by wrapping…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also stretchable · vtracer · pdf417gen · svg.py · uharfbuzz · pansi · rendercv-fonts · CairoSVG · PyQRCode · sphinx_design