Skip to main content

img-gen

Rust Python codecov

Generate images from a deterministic data structure.

This project is written in Rust but ships as a Python package also.

Distributions

Rust

name version docs
img-gen crates.io docs.rs
img-gen-renderer crates.io docs.rs
img-gen-spec crates.io docs.rs

Python

name version docs
img-gen PyPI gh-pages

Examples

The below examples use the following YAML doc as a file named example-layout.yml.

layers:
  - background:
      color: "#4051b5"
  - icon:
      image: material/cat
      color: white
    offset: { x: 100, y: 100 }
    size: { width: 100, height: 100 }

Python

import asyncio # the only supported async runtime in python
from pathlib import Path

# configure loggers before importing this lib
from img_gen import Layout, Generator

async def main():
    generator = Generator(
        # add any external image/font paths (file or dir) here
        external_resource_paths=[],
        cache_root=None,  # use default cache dir
    )

    layout = Layout.from_yaml_str(yaml_str)
    yaml_str = Path("example-layout.yml").read_text(encoding="utf-8")

    # Generator.render() is async
    img = await generator.render(layout)

    img_hash = img.sha256
    img.save(f"{img_hash}.png")

Rust

use img_gen::{Generator, Layout};
use serde::Deserialize;

#[tokio::main]
async fn main() {
    let external_resource_paths = vec![]; // not using external images/fonts
    let cache_root = None; // use default value
    let generator = Generator::new(external_resource_paths, cache_root).unwrap();

    // using safer/newer yaml deserializing crate `serde_saphyr`
    let yaml_str = std::fs::read("example-layout.yml").unwrap();
    let layout: Layout = serde_saphyr::from_str(&yaml_str).unwrap();

    let img = generator.render(layout).await.unwrap();

    let img_hash = img.get_sha256().unwrap();
    img.save(format!("{img_hash}.png").as_str()).unwrap();
}

Metadata

Release files for img-gen 0.2.5

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

Source distribution (sdist)

Source distribution for img-gen 0.2.5
File Size Uploaded Provenance Actions
img_gen-0.2.5.tar.gz 134.4 kB With provenance Details for img_gen-0.2.5.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for img-gen 0.2.5
File Actions
img_gen-0.2.5-cp311-abi3-win_arm64.whl CPython 3.11 abi3 Windows ARM64 Details for img_gen-0.2.5-cp311-abi3-win_arm64.whl
img_gen-0.2.5-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for img_gen-0.2.5-cp310-abi3-win_amd64.whl
img_gen-0.2.5-cp310-abi3-win32.whl CPython 3.10 abi3 Windows x86-32 Details for img_gen-0.2.5-cp310-abi3-win32.whl
img_gen-0.2.5-cp310-abi3-musllinux_1_2_x86_64.whl CPython 3.10 abi3 Linux musl 1.2+ x86-64 Details for img_gen-0.2.5-cp310-abi3-musllinux_1_2_x86_64.whl
img_gen-0.2.5-cp310-abi3-musllinux_1_2_i686.whl CPython 3.10 abi3 Linux musl 1.2+ x86-32 Details for img_gen-0.2.5-cp310-abi3-musllinux_1_2_i686.whl
img_gen-0.2.5-cp310-abi3-musllinux_1_2_armv7l.whl CPython 3.10 abi3 Linux musl 1.2+ ARMv7l Details for img_gen-0.2.5-cp310-abi3-musllinux_1_2_armv7l.whl
img_gen-0.2.5-cp310-abi3-musllinux_1_2_aarch64.whl CPython 3.10 abi3 Linux musl 1.2+ ARM64 Details for img_gen-0.2.5-cp310-abi3-musllinux_1_2_aarch64.whl
img_gen-0.2.5-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details for img_gen-0.2.5-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
img_gen-0.2.5-cp310-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl CPython 3.10 abi3 Linux glibc 2.17+ IBM System/390x Details for img_gen-0.2.5-cp310-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
img_gen-0.2.5-cp310-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl CPython 3.10 abi3 Linux glibc 2.17+ PowerPC 64-le Details for img_gen-0.2.5-cp310-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
img_gen-0.2.5-cp310-abi3-manylinux_2_17_i686.manylinux2014_i686.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-32 Details for img_gen-0.2.5-cp310-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
img_gen-0.2.5-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl CPython 3.10 abi3 Linux glibc 2.17+ ARMv7l Details for img_gen-0.2.5-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
img_gen-0.2.5-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details for img_gen-0.2.5-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
img_gen-0.2.5-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for img_gen-0.2.5-cp310-abi3-macosx_11_0_arm64.whl
img_gen-0.2.5-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details for img_gen-0.2.5-cp310-abi3-macosx_10_12_x86_64.whl

Total release size: 193.0 MB

Release files / img_gen-0.2.5.tar.gz

Download URL img_gen-0.2.5.tar.gz
Size 134.4 kB
Tags Source
SHA-256 checksum
How to use checksums
60f69ca37944a9a144ff21cdf773c8550c9f247bbc00ee7c4e523b636a708047
BLAKE2b-256 checksum
How to use checksums
c781ad50e159fbe372a0e7945e910c788cc34f086d74842b07bddfd5ac9e8e90
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 10, 2026.

Transparency log

Release files / img_gen-0.2.5-cp311-abi3-win_arm64.whl

Download URL img_gen-0.2.5-cp311-abi3-win_arm64.whl
Size 12.2 MB
Tags CPython 3.11 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
ddcdb0e523cbfbd6e2384afd3c6f0d6698d23ff3c6ef3bc0b356c00bc7aa56e9
BLAKE2b-256 checksum
How to use checksums
6ddb54baae7471badef44dd81568a29f3dd7ea81db41ef1aa2362b380d3758a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 10, 2026.

Transparency log

Release files / img_gen-0.2.5-cp310-abi3-win_amd64.whl

Download URL img_gen-0.2.5-cp310-abi3-win_amd64.whl
Size 12.7 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
a0c0e0f9d1d5e7028889be093591f8cb2af825cf806a10eb5e1bc5ea413369c6
BLAKE2b-256 checksum
How to use checksums
afc13e781e17539b1ab731a695f97e73baac80ef12f8af10c4b6b0d4e4741ed8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 10, 2026.

Transparency log

Release files / img_gen-0.2.5-cp310-abi3-win32.whl

Download URL img_gen-0.2.5-cp310-abi3-win32.whl
Size 12.2 MB
Tags CPython 3.10 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
c45a6690cd8b6abbc1bcf203c1a277332442b48632b45e445d0140cbb105db53
BLAKE2b-256 checksum
How to use checksums
4ba1d5f28c2d7f93230c235de2b2b65a99a7ef826e66d090d2897b735f069a05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 10, 2026.

Transparency log

Release files / img_gen-0.2.5-cp310-abi3-musllinux_1_2_x86_64.whl

Download URL img_gen-0.2.5-cp310-abi3-musllinux_1_2_x86_64.whl
Size 13.1 MB
Tags CPython 3.10 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
f679b5ace1dc2046d7013d17da436423dc1204a1f08a17d35b1d67d325b3d447
BLAKE2b-256 checksum
How to use checksums
0408ba6ff51d185e436c756e9ad7701c91fb652b011973ec43b65400396af87f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 10, 2026.

Transparency log

Release files / img_gen-0.2.5-cp310-abi3-musllinux_1_2_i686.whl

Download URL img_gen-0.2.5-cp310-abi3-musllinux_1_2_i686.whl
Size 12.8 MB
Tags CPython 3.10 Linux musl 1.2+ x86-32 abi3
SHA-256 checksum
How to use checksums
027e923549fdd17b9022bf6503ccd21139c238abe09603c8ed751ba8cdae99ef
BLAKE2b-256 checksum
How to use checksums
8fce7477c1c2fea1b9648ac740f4b516e4da866c7948a883eb10ffbc72edb235
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 10, 2026.

Transparency log

Release files / img_gen-0.2.5-cp310-abi3-musllinux_1_2_armv7l.whl

Download URL img_gen-0.2.5-cp310-abi3-musllinux_1_2_armv7l.whl
Size 11.7 MB
Tags CPython 3.10 Linux musl 1.2+ ARMv7l abi3
SHA-256 checksum
How to use checksums
67109257ac9704a0561b153a3dba5f5d35383e9d10d0f8aac49b59996d7929e2
BLAKE2b-256 checksum
How to use checksums
f12d9ba3982febf0ffe3992bf59e8bb6db8fccdec58e3953a367f943b40d31df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 10, 2026.

Transparency log

Release files / img_gen-0.2.5-cp310-abi3-musllinux_1_2_aarch64.whl

Download URL img_gen-0.2.5-cp310-abi3-musllinux_1_2_aarch64.whl
Size 12.4 MB
Tags CPython 3.10 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
9506670a5802d426fb43912a44d994e83ab03335318e694e2daea313c9f74f17
BLAKE2b-256 checksum
How to use checksums
9f2c422d52f44ad8bf7cbf959be84f388b14ba6f9b2b0bec8f2e8a8b31efeace
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 10, 2026.

Transparency log

Release files / img_gen-0.2.5-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL img_gen-0.2.5-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 13.1 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
73b71253305bff207db8e5d63968d7046d3b348c2ca32b2134ce05a1aedcca27
BLAKE2b-256 checksum
How to use checksums
6f93a497190ccc83057145b03505a5fcd6cb1b81494ac3ab50069c1dee463c75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 10, 2026.

Transparency log

Release files / img_gen-0.2.5-cp310-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl

Download URL img_gen-0.2.5-cp310-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Size 13.9 MB
Tags CPython 3.10 Linux glibc 2.17+ IBM System/390x abi3
SHA-256 checksum
How to use checksums
de979518c2edf1fc298f19a247dbe57ec4e1557ac0357b14c39c814c26780b72
BLAKE2b-256 checksum
How to use checksums
4bacdabc964d2f6566d0fe0dfb3c6f51caeaed478172524b92114db4ed84bc06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 10, 2026.

Transparency log

Release files / img_gen-0.2.5-cp310-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl

Download URL img_gen-0.2.5-cp310-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Size 15.6 MB
Tags CPython 3.10 Linux glibc 2.17+ PowerPC 64-le abi3
SHA-256 checksum
How to use checksums
0c0edf4ee3decef2217eb0b3cc982fe4325d4400ab6d399d4fe8978d69530ea3
BLAKE2b-256 checksum
How to use checksums
5a32b3746d7dfd6b5d00819b53ee66f7b1975f3a51a5106f19bcf9ad38aa1ab9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 10, 2026.

Transparency log

Release files / img_gen-0.2.5-cp310-abi3-manylinux_2_17_i686.manylinux2014_i686.whl

Download URL img_gen-0.2.5-cp310-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Size 13.3 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-32 abi3
SHA-256 checksum
How to use checksums
6c11968970c72f29bdf3bb05ef7827bf68374e47c4f8174a23d290e8acf0c78c
BLAKE2b-256 checksum
How to use checksums
363062b9cfeb14a6597e57aaebc6145d96ee9ee8508d6d6e46f810167016f84f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 10, 2026.

Transparency log

Release files / img_gen-0.2.5-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl

Download URL img_gen-0.2.5-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Size 11.7 MB
Tags CPython 3.10 Linux glibc 2.17+ ARMv7l abi3
SHA-256 checksum
How to use checksums
af18afb2b78c9660d0076b3f3cc44d32804eeac085c200566d9b9baef81e65aa
BLAKE2b-256 checksum
How to use checksums
61d881c8bee02062714abb481341c81a38ab3694e4fccaefd6bbf415a929649a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 10, 2026.

Transparency log

Release files / img_gen-0.2.5-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL img_gen-0.2.5-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 12.4 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
42c9b98fe48b697118f2e623e089b7be6008f098f3d91443d8c6f63d226d0f0e
BLAKE2b-256 checksum
How to use checksums
a40772e461bb337b1fecaee865193bac2454e9ad2cd1fabbe368cdffd8488b31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 10, 2026.

Transparency log

Release files / img_gen-0.2.5-cp310-abi3-macosx_11_0_arm64.whl

Download URL img_gen-0.2.5-cp310-abi3-macosx_11_0_arm64.whl
Size 12.8 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
e4aa0d5839780f937fd4d1440626d6d80cc78825f85c0db007ce67be315ae7cd
BLAKE2b-256 checksum
How to use checksums
dedb4abafd6e294428ab9e220b0a3c9e103872045c4a0362c43ea4161d37d51e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 10, 2026.

Transparency log

Release files / img_gen-0.2.5-cp310-abi3-macosx_10_12_x86_64.whl

Download URL img_gen-0.2.5-cp310-abi3-macosx_10_12_x86_64.whl
Size 13.0 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
f2bb67fe5cec06d68fac1139e8b63425ffb2a83e4d1b0b554637de385f038da0
BLAKE2b-256 checksum
How to use checksums
a1d515f9ac9d8a48b0a3292d25100ed7e6e0449f32b94c835dd9d0604cb18e60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 10, 2026.

Transparency log

Security for img-gen 0.2.5

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.

Full provenance

All 16 files in this release have been uploaded with provenance metadata.

Select from 16 files

Attestation for img_gen-0.2.5.tar.gz

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 Oct 10, 2026.

Transparency log

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