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.4

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.4
File Size Uploaded
img_gen-0.2.4.tar.gz 133.4 kB Details

Built distributions (wheels)

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

Total release size: 195.3 MB

Release files / img_gen-0.2.4.tar.gz

Download URL img_gen-0.2.4.tar.gz
Size 133.4 kB
Tags Source
SHA-256 checksum
How to use checksums
72697dd47e07546a220bb072bbbf5f8b8b27abf643a90192b9b3ceb5e5aff2b1
BLAKE2b-256 checksum
How to use checksums
58d39be6aa9f82281105267f7de39df9cd3e5548ef09178919c533e8781c09eb
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 Aug 8, 2026.

Transparency log

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

Download URL img_gen-0.2.4-cp311-abi3-win_arm64.whl
Size 12.4 MB
Tags CPython 3.11 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
8ca78df51aa530cfe65713589b782ab70a9c9c49918f476bf492c6d6ce76a908
BLAKE2b-256 checksum
How to use checksums
06426a552cecfc1ed2d6d789f0756ac269d90a5c48ba1da5b6112e6cdb3b41a5
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 Aug 8, 2026.

Transparency log

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

Download URL img_gen-0.2.4-cp310-abi3-win_amd64.whl
Size 12.8 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
c318a7c9d92a92059b196119f6ee7fa6a645ffb351347c0ac2ae2543bdb24b3d
BLAKE2b-256 checksum
How to use checksums
a848ff26311bd106f7deae0e9d6f8369bd82fc576857378c92b9aa48edc49d93
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 Aug 8, 2026.

Transparency log

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

Download URL img_gen-0.2.4-cp310-abi3-win32.whl
Size 12.3 MB
Tags CPython 3.10 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
cdb6c7c10841dfd8eadecb3676ba1f3c9208ad7f99cf6bec221f076338e76300
BLAKE2b-256 checksum
How to use checksums
01931f15b82709bcbd16d5c953f0d3aac25dbba7d9c2af1f63c79a8ed9f469d1
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 Aug 8, 2026.

Transparency log

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

Download URL img_gen-0.2.4-cp310-abi3-musllinux_1_2_x86_64.whl
Size 13.2 MB
Tags CPython 3.10 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
883afee3879c0c56aaf56674a76339b95f2e22d9d688abd9a52f7de076beff43
BLAKE2b-256 checksum
How to use checksums
b32966b8abc6590ce1afdecbabe6a2660ed5f8e9998b42be3373e97cd640086c
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 Aug 8, 2026.

Transparency log

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

Download URL img_gen-0.2.4-cp310-abi3-musllinux_1_2_i686.whl
Size 12.9 MB
Tags CPython 3.10 Linux musl 1.2+ x86-32 abi3
SHA-256 checksum
How to use checksums
14d736520c96b9632b73a8f16f98134c3832fd167a1a8e20dada637473ffd83c
BLAKE2b-256 checksum
How to use checksums
507110f221236183981551c876ee0a16062eea1c6013f53856f272d2248c1982
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 Aug 8, 2026.

Transparency log

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

Download URL img_gen-0.2.4-cp310-abi3-musllinux_1_2_armv7l.whl
Size 11.9 MB
Tags CPython 3.10 Linux musl 1.2+ ARMv7l abi3
SHA-256 checksum
How to use checksums
404fe8c805e83727c1654d710e97eeb948a14136f785226c58f45c45f40a348d
BLAKE2b-256 checksum
How to use checksums
fa4a2ae5fd84c55aac21096378c56bcfcdc3117355bc6ae4713925d8a04eb0e2
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 Aug 8, 2026.

Transparency log

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

Download URL img_gen-0.2.4-cp310-abi3-musllinux_1_2_aarch64.whl
Size 12.5 MB
Tags CPython 3.10 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
f7ff1aa40902e35911a97c122a220bba16f9a87ee69bdd0ca13e5d83688b1048
BLAKE2b-256 checksum
How to use checksums
efb66a816775a26aece55ea288a134fe7347c20bf2874b23c4e0131d0403a5f8
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 Aug 8, 2026.

Transparency log

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

Download URL img_gen-0.2.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 13.2 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
c7d913ac89ffe4b947c584fed97425eef88f070f43a8ceb96994bff0d710b5d1
BLAKE2b-256 checksum
How to use checksums
cad91ac1aac2f01e01030ba3161ff0e4d62a5b4ba9374682a1334df99b3a12c5
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 Aug 8, 2026.

Transparency log

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

Download URL img_gen-0.2.4-cp310-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Size 14.1 MB
Tags CPython 3.10 Linux glibc 2.17+ IBM System/390x abi3
SHA-256 checksum
How to use checksums
ac204dd2fa32b6c3892565f9e0cb4712f2e8e4fbd9bc9076be3e80f8e0818542
BLAKE2b-256 checksum
How to use checksums
ec3984a3be849ca5541cb1cec9f926a0eac9fefa8dccf9aeff65017cf65d71e6
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 Aug 8, 2026.

Transparency log

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

Download URL img_gen-0.2.4-cp310-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Size 15.8 MB
Tags CPython 3.10 Linux glibc 2.17+ PowerPC 64-le abi3
SHA-256 checksum
How to use checksums
8a291da20327ec9af74c8b4899cf30122d16aec5bd9563b2fce3c729e48ec721
BLAKE2b-256 checksum
How to use checksums
991f47c87e9a8b71bd4e3cfa4ea6fedf3d2132d3203aae398f437b70f3dcae36
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 Aug 8, 2026.

Transparency log

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

Download URL img_gen-0.2.4-cp310-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Size 13.4 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-32 abi3
SHA-256 checksum
How to use checksums
3410f31df84cc5476987da14268e421449c0f1654dbc59a396148a36477d2388
BLAKE2b-256 checksum
How to use checksums
89f5d44aa145cfae8ea96cfcc411046d30781eab7847b566fdb2641ac9495695
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 Aug 8, 2026.

Transparency log

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

Download URL img_gen-0.2.4-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Size 11.9 MB
Tags CPython 3.10 Linux glibc 2.17+ ARMv7l abi3
SHA-256 checksum
How to use checksums
981f9b87ad23615e3d46b62ca1711ccdcab1d12601b390c3aea946fbf764b9d8
BLAKE2b-256 checksum
How to use checksums
3de4f59c1ba9f9584cc91476b08a20994a6bb15c4dac82556bc8e985a3918e4d
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 Aug 8, 2026.

Transparency log

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

Download URL img_gen-0.2.4-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 12.5 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
5f8b8df80f8597e80bd149e78f4d003a63f6df636d854422114b716be9efb3e6
BLAKE2b-256 checksum
How to use checksums
fbf998e1f00a298da30aaab43da88f931f6c6592515c3449815fd022fd35f9a9
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 Aug 8, 2026.

Transparency log

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

Download URL img_gen-0.2.4-cp310-abi3-macosx_11_0_arm64.whl
Size 13.0 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c1a99d51c36f51a467044ef05e86b99ff256cc17cdebf2c8516766785933eab4
BLAKE2b-256 checksum
How to use checksums
2a75dba9cd94b3df873148522d147eee4f13e8291a51df5c83ff4e70aa2d8c8a
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 Aug 8, 2026.

Transparency log

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

Download URL img_gen-0.2.4-cp310-abi3-macosx_10_12_x86_64.whl
Size 13.2 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
081b9d0a81fde5a73f7005d8b312f876b31b6a65c92b0a5506deec885d82d8ac
BLAKE2b-256 checksum
How to use checksums
f1ac10c02f89797f57d384edf2e5358f97a79a48a3cd210ee9372f967d44a79e
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 Aug 8, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.4 This release

16 release files

0.2.3

16 release files

0.2.2

15 release files

0.2.1

15 release files

0.2.0

15 release files

0.1.0

15 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