{"id":37992538,"url":"https://github.com/nathanielfernandes/imagetext-py","last_synced_at":"2026-01-16T18:44:42.047Z","repository":{"id":65350683,"uuid":"590654521","full_name":"nathanielfernandes/imagetext-py","owner":"nathanielfernandes","description":"A blazing fast text drawing library","archived":false,"fork":false,"pushed_at":"2024-04-01T17:25:37.000Z","size":343,"stargazers_count":82,"open_issues_count":4,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-31T10:31:30.074Z","etag":null,"topics":["drawing","emoji-support","emojis","font","fonts","image","pyo3","rust-bindings","text","text-drawing"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/imagetext-py/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nathanielfernandes.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-01-18T22:28:55.000Z","updated_at":"2025-10-30T10:04:58.000Z","dependencies_parsed_at":"2023-11-19T03:25:16.900Z","dependency_job_id":"140be776-a2e7-4fc4-a35a-a720cc00f591","html_url":"https://github.com/nathanielfernandes/imagetext-py","commit_stats":{"total_commits":34,"total_committers":1,"mean_commits":34.0,"dds":0.0,"last_synced_commit":"745655b85afe866ac778633cc511e4b113856eb0"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/nathanielfernandes/imagetext-py","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathanielfernandes%2Fimagetext-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathanielfernandes%2Fimagetext-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathanielfernandes%2Fimagetext-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathanielfernandes%2Fimagetext-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nathanielfernandes","download_url":"https://codeload.github.com/nathanielfernandes/imagetext-py/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathanielfernandes%2Fimagetext-py/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28481180,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["drawing","emoji-support","emojis","font","fonts","image","pyo3","rust-bindings","text","text-drawing"],"created_at":"2026-01-16T18:44:41.989Z","updated_at":"2026-01-16T18:44:42.038Z","avatar_url":"https://github.com/nathanielfernandes.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \n  ![hero banner](./assets/hero.png)\n  \n  ### A blazing fast text drawing library\n  ###### imagetext-py is python bindings for [imagetext](https://github.com/nathanielfernandes/imagetext)\n\n\u003c!-- [![CI](https://github.com/nathanielfernandes/imagetext-py/actions/workflows/CI.yml/badge.svg?event=push)](https://github.com/nathanielfernandes/imagetext-py/actions/workflows/CI.yml) --\u003e\n\n[![pypi](https://img.shields.io/pypi/v/imagetext-py)](https://pypi.org/project/imagetext-py/)\n[![Downloads](https://static.pepy.tech/personalized-badge/imagetext-py?period=total\u0026units=international_system\u0026left_color=grey\u0026right_color=blue\u0026left_text=Downloads)](https://pepy.tech/project/imagetext-py)\n![PythonVersions](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue)\n[![discord](https://img.shields.io/discord/1067663746786414632?label=discord)](https://discord.gg/e4T2qycHJz)\n\n---\n\n\u003c/div\u003e\n\n\u003e if you found this library useful, consider leaving a star ⭐\n\n## About\n\nimagetext makes use of [rusttype](https://github.com/redox-os/rusttype) for font parsing and [tiny-skia](https://github.com/RazrFalcon/tiny-skia) for drawing. It has a simple API that allows you to draw text with ease.\n\nCurrently imagetext-py does beat out Pillow for most of the cases I've tested, but I will setup some benchmarks soon.\n\n## Features\n\n- Multi-line text\n- Text wrapping\n- Text alignment\n- Font fallbacks\n- Text stroke\n- Gradient fills\n- Emojis! (almost every platform supported, including discord)\n- Global Font Database with css-like font querying\n\n\u003e Note: emojis are fetched and cached from the internet during runtime, so you will need an internet connection to use them. The ability to use local emoji images will be added soon.\n\n## Installation\n\n```bash\npip install imagetext-py\n```\n\n## Example Usage\n\n```python\nfrom PIL import Image\nfrom imagetext_py import *\n\n# supports fonts with fallbacks\nFontDB.LoadFromDir(\".\")\nfont = FontDB.Query(\"coolvetica japanese\")\n\n# create a canvas to draw on\ncv = Canvas(512, 512, (255, 255, 255, 255))\n\n# paints are used to fill and stroke text\nblack = Paint.Color((0, 0, 0, 255))\nrainbow = Paint.Rainbow((0.0,0.0), (256.0,256.0))\n\n# if a font doesn't have a glyph for a character, it will use the fallbacks\ntext = \"hello my 😓 n🐢ame i☕s 会のすべ aての構成員 nathan and i drink soup boop coop, the quick brown fox jumps over the lazy dog\"\n\ndraw_text_wrapped(canvas=cv,              # the canvas to draw on\n                  text=text,\n                  x=256, y=256,           # the position of the text\n                  ax=0.5, ay=0.5,         # the anchor of the text\n                  size=67,                # the size of the text\n                  width=500,              # the width of the text\n                  font=font,\n                  fill=black,\n                  align=TextAlign.Center,\n                  stroke=2.0,             # the stroke width (optional)\n                  stroke_color=rainbow,\n                  draw_emojis=True)   # the stroke color (optional)\n\n# you can convert the canvas to a PIL image\nim: Image.Image = cv.to_image()\nim.save(\"test.png\")\n\n# or you can just get the raw bytes\ndimensions, bytes = cv.to_bytes()\n\n# you can also save directly to a file\ncv.save(\"test.png\")\n```\n\nproduces this image:\n\n![test.png](./assets/ex1.png)\n\n## Pillow and FontDB Usage\n\n```python\nfrom PIL import Image\nfrom imagetext_py import *\n\nFontDB.SetDefaultEmojiOptions(EmojiOptions(parse_discord_emojis=True))\nFontDB.LoadFromDir(\".\")\n\nfont = FontDB.Query(\"coolvetica japanese\")\n\nwith Image.new(\"RGBA\", (512, 512), \"white\") as im:\n    with Writer(im) as w:\n        w.draw_text_wrapped(\n            text=\"hello from python 😓 lol, \u003c:blobpain:739614945045643447\u003e \" \\\n                 \"ほまみ \u003c:chad:682819256173461522\u003e\u003c:bigbrain:744344773229543495\u003e \" \\\n                 \"emojis workin\",\n            x=256, y=256,\n            ax=0.5, ay=0.5,\n            width=500,\n            size=90,\n            font=font,\n            fill=Paint.Color((0, 0, 0, 255)),\n            align=TextAlign.Center,\n            stroke=2.0,\n            stroke_color=Paint.Rainbow((0.0,0.0), (256.0,256.0)),\n            draw_emojis=True\n        )\n    im.save(\"test.png\")\n```\n\nproduces this image:\n\n![test.png](./assets/ex2.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnathanielfernandes%2Fimagetext-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnathanielfernandes%2Fimagetext-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnathanielfernandes%2Fimagetext-py/lists"}