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, font_size=12)

For better consistency across platforms and easier reproducibility, we need to specify the exact fonts.

from font_download import FontConfig
from font_download.example_fonts.noto_sans import FONTS_NOTO_SANS
from pixel_renderer import PixelRendererProcessor

font_config = FontConfig(sources=FONTS_NOTO_SANS)
pixel_processor = PixelRendererProcessor(font=font_config)

pixel_processor.render_text_image("hello!").save("demos_output/hello.png")

pixel_processor.save_pretrained("demos_output/processor")

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.5.tar.gz (17.9 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.5-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pixel_renderer-0.0.5.tar.gz
  • Upload date:
  • Size: 17.9 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.5.tar.gz
Algorithm Hash digest
SHA256 737987fa01bc82cc824ae9a1dd9e057f13267d9d3c7e4f38104c0c7da6ba44d3
MD5 57ced717fd9e680a7854f3b9f9158eb9
BLAKE2b-256 d1a3ed2eaf710f0447edea8fd241b635c6c59a6e0ba7b7feba87e80582be7861

See more details on using hashes here.

Provenance

The following attestation bundles were made for pixel_renderer-0.0.5.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.5-py3-none-any.whl.

File metadata

  • Download URL: pixel_renderer-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 19.7 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 b9bcde47a8909823559505cb0c3325e89bbbf349abc5d0be7044d3432228b0b0
MD5 1a32ea74725dfcdc10278a3b4e562b36
BLAKE2b-256 3a4d2e5ae7571f5cf5851f7fc9c0b516ee292100beef34f91ceae5b2276fd9d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for pixel_renderer-0.0.5-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