Skip to main content

Text renderer for PIXEL models

Project description

PIXEL Renderer

This repository contains a text renderer for PIXEL models.

Usage

Install dependencies:

conda create -n pixel python=3.12 -y
conda activate pixel
pip install ".[dev,pangocairo]"

[!TIP] Having trouble installing pycairo and pygobject? See these instructions.

Install:

pip install "pixel-renderer[pangocairo]"

Render text as an image (array):

from pixel_renderer.renderer import render_text

render_text(text="test", block_size=16, dpi=120, font_size=12)

[!CAUTION] Our text renderer relies on the computer's font rendering capabilities. Rendering on different systems may yield different results (e.g. emoji). It is a work in progress to create a more robust renderer, decoupled from the system's font rendering, for better consistency across platforms and easier reproducibility.

Cite

If you use this code in your research, please consider citing the work:

@misc{pixel2025renderer,
  title={PIXEL Renderer},
  author={Moryossef, Amit and Kesen, Ilker},
  howpublished={\url{https://github.com/sign/pixel-renderer}},
  year={2025}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pixel_renderer-0.0.2.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pixel_renderer-0.0.2-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file pixel_renderer-0.0.2.tar.gz.

File metadata

  • Download URL: pixel_renderer-0.0.2.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pixel_renderer-0.0.2.tar.gz
Algorithm Hash digest
SHA256 7e56694c6b36283b16655c08f9f68a6475dc7505ce6544c08cac5c9ee6a3edbe
MD5 40554c6891079f79421eebaecb3746cb
BLAKE2b-256 6f0cc802baea8f414e2c51eb19d041a6ccadd18b14e6833c5b018e1c95b89b03

See more details on using hashes here.

Provenance

The following attestation bundles were made for pixel_renderer-0.0.2.tar.gz:

Publisher: release.yaml on sign/pixel-renderer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pixel_renderer-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: pixel_renderer-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pixel_renderer-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fbb167c7f2fad6c3f76800277f16adc9c3b574afe3c64b5bb6352c7ffd71e60a
MD5 150ce279389d645946eddb5b24940259
BLAKE2b-256 5a282affa02d0afdf1ad2fe42d630e668b8b3f4ee84a9fe8347fd1e5f6e5c24f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pixel_renderer-0.0.2-py3-none-any.whl:

Publisher: release.yaml on sign/pixel-renderer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page