pictex


Namepictex JSON
Version 0.2.1 PyPI version JSON
download
home_pageNone
SummaryA library to generate stylized text images.
upload_time2025-07-10 21:33:51
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseNone
keywords graphics image-generation skia text-rendering text-to-image typography
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # PicTex

[![PyPI version](https://badge.fury.io/py/pictex.svg)](https://badge.fury.io/py/pictex)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

A powerful Python library to create beautifully styled text images with a simple, fluent API. Powered by Skia.

![PicTex](https://raw.githubusercontent.com/francozanardi/pictex/main/docs/assets/readme-1.png)

**`PicTex`** makes it easy to generate styled text images for social media, video overlays, digital art, or any application where stylized text is needed. It abstracts away the complexity of graphics libraries, offering a declarative and chainable interface inspired by CSS.

## Features

-   **Fluent & Reusable API**: Build styles declaratively and reuse them.
-   **Rich Styling**: Gradients, multiple shadows, outlines, and text decorations.
-   **Advanced Typography**: Custom fonts, variable fonts, line height, and alignment.
-   **Automatic Font Fallback**: Seamlessly render emojis and special characters even if your main font doesn't support them.
-   **Flexible Output**: Save as PNG, or convert to NumPy arrays or Pillow images with ease.
-   **High-Quality Rendering**: Powered by Google's Skia graphics engine.

## Installation

```bash
pip install pictex
```

## Quickstart

Creating a stylized text image is as simple as building a `Canvas` and calling `.render()`.

```python
from pictex import Canvas

# 1. Create a style template using the fluent API
canvas = (
    Canvas()
    .font_family("path/to/font.ttf")
    .font_size(60)
    .color("white")
    .padding(20)
    .background_color(LinearGradient(["#2C3E50", "#FD746C"]))
    .background_radius(10)
    .add_shadow(offset=(2, 2), blur_radius=3, color="black")
)

# 2. Render some text using the template
image = canvas.render("Hello, PicTex! 🎨✨")

# 3. Save or show the result
image.save("hello.png")

```

![Quickstart result](https://raw.githubusercontent.com/francozanardi/pictex/main/docs/assets/readme-2.png)

## 📚 Dive Deeper

For a complete guide on all features, including text decorations, advanced gradients, smart cropping, and more, check out our full documentation:

-   [**Getting Started & Core Concepts**](docs/getting_started.md)
-   [**Styling Guide: Colors & Gradients**](docs/colors.md)
-   [**Styling Guide: Text & Fonts**](docs/text.md)
-   [**Styling Guide: Containers & Effects**](docs/effects.md)
-   API Reference (coming soon)

## Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the [issues page](https://github.com/francozanardi/pictex/issues).

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pictex",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "graphics, image-generation, skia, text-rendering, text-to-image, typography",
    "author": null,
    "author_email": "Franco Zanardi <francozanardi97@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/4e/57/056ec5f38ebe7d314375c8e3fdaf62245441f35b53177c5b83c869d86300/pictex-0.2.1.tar.gz",
    "platform": null,
    "description": "# PicTex\n\n[![PyPI version](https://badge.fury.io/py/pictex.svg)](https://badge.fury.io/py/pictex)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA powerful Python library to create beautifully styled text images with a simple, fluent API. Powered by Skia.\n\n![PicTex](https://raw.githubusercontent.com/francozanardi/pictex/main/docs/assets/readme-1.png)\n\n**`PicTex`** makes it easy to generate styled text images for social media, video overlays, digital art, or any application where stylized text is needed. It abstracts away the complexity of graphics libraries, offering a declarative and chainable interface inspired by CSS.\n\n## Features\n\n-   **Fluent & Reusable API**: Build styles declaratively and reuse them.\n-   **Rich Styling**: Gradients, multiple shadows, outlines, and text decorations.\n-   **Advanced Typography**: Custom fonts, variable fonts, line height, and alignment.\n-   **Automatic Font Fallback**: Seamlessly render emojis and special characters even if your main font doesn't support them.\n-   **Flexible Output**: Save as PNG, or convert to NumPy arrays or Pillow images with ease.\n-   **High-Quality Rendering**: Powered by Google's Skia graphics engine.\n\n## Installation\n\n```bash\npip install pictex\n```\n\n## Quickstart\n\nCreating a stylized text image is as simple as building a `Canvas` and calling `.render()`.\n\n```python\nfrom pictex import Canvas\n\n# 1. Create a style template using the fluent API\ncanvas = (\n    Canvas()\n    .font_family(\"path/to/font.ttf\")\n    .font_size(60)\n    .color(\"white\")\n    .padding(20)\n    .background_color(LinearGradient([\"#2C3E50\", \"#FD746C\"]))\n    .background_radius(10)\n    .add_shadow(offset=(2, 2), blur_radius=3, color=\"black\")\n)\n\n# 2. Render some text using the template\nimage = canvas.render(\"Hello, PicTex! \ud83c\udfa8\u2728\")\n\n# 3. Save or show the result\nimage.save(\"hello.png\")\n\n```\n\n![Quickstart result](https://raw.githubusercontent.com/francozanardi/pictex/main/docs/assets/readme-2.png)\n\n## \ud83d\udcda Dive Deeper\n\nFor a complete guide on all features, including text decorations, advanced gradients, smart cropping, and more, check out our full documentation:\n\n-   [**Getting Started & Core Concepts**](docs/getting_started.md)\n-   [**Styling Guide: Colors & Gradients**](docs/colors.md)\n-   [**Styling Guide: Text & Fonts**](docs/text.md)\n-   [**Styling Guide: Containers & Effects**](docs/effects.md)\n-   API Reference (coming soon)\n\n## Contributing\n\nContributions, issues, and feature requests are welcome! Feel free to check the [issues page](https://github.com/francozanardi/pictex/issues).\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A library to generate stylized text images.",
    "version": "0.2.1",
    "project_urls": {
        "Homepage": "https://github.com/francozanardi/pictex",
        "Repository": "https://github.com/francozanardi/pictex"
    },
    "split_keywords": [
        "graphics",
        " image-generation",
        " skia",
        " text-rendering",
        " text-to-image",
        " typography"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "9ed4ca4f43c0004849ab08ea3f1861d042a57e4f2a7292f347becf282e724f6e",
                "md5": "f9971f3158cc38b4758fb0642b6b0c6a",
                "sha256": "331c7d59c5f6127be68cf464e7b1514c69b2097b5a592e7283679c1c60fe2e18"
            },
            "downloads": -1,
            "filename": "pictex-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f9971f3158cc38b4758fb0642b6b0c6a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 20885,
            "upload_time": "2025-07-10T21:33:50",
            "upload_time_iso_8601": "2025-07-10T21:33:50.034337Z",
            "url": "https://files.pythonhosted.org/packages/9e/d4/ca4f43c0004849ab08ea3f1861d042a57e4f2a7292f347becf282e724f6e/pictex-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "4e57056ec5f38ebe7d314375c8e3fdaf62245441f35b53177c5b83c869d86300",
                "md5": "16607fcf81932665da7f6b56874bc8dd",
                "sha256": "dc435fcb98d1d57e0cc2f5e97a20646be5714a74599aebe007bbc679b3532357"
            },
            "downloads": -1,
            "filename": "pictex-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "16607fcf81932665da7f6b56874bc8dd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 447227,
            "upload_time": "2025-07-10T21:33:51",
            "upload_time_iso_8601": "2025-07-10T21:33:51.877788Z",
            "url": "https://files.pythonhosted.org/packages/4e/57/056ec5f38ebe7d314375c8e3fdaf62245441f35b53177c5b83c869d86300/pictex-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-10 21:33:51",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "francozanardi",
    "github_project": "pictex",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pictex"
}
        
Elapsed time: 1.93936s