Registry / devops / pilmoji

pilmoji

JSON →
library2.0.5pypypi✓ verified 84d ago

Pilmoji is a Python library for rendering emojis and Unicode symbols using Pillow. It converts emoji shortcodes and Unicode emoji into images, with support for custom fonts and colors. Version 2.0.5 supports Python >=3.8. It is actively maintained with occasional releases.

pip install pilmoji
INSTALL
IMPORT
SIG · PILMOJI
P
pilmoji
devopspythonv2.0.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Pilmoji
from pilmoji import Pilmoji
Twemoji
from pilmoji.twemoji import Twemoji
from pilmoji import Twemoji
Twemoji is in a submodule, not directly in pilmoji.

Renders emoji in a Pillow image using Pilmoji context manager.

from pilmoji import Pilmoji from PIL import Image, ImageDraw img = Image.new('RGB', (200, 100), (255, 255, 255)) draw = ImageDraw.Draw(img) with Pilmoji(img) as pilmoji: pilmoji.text((10, 10), 'Hello 😊!', fill='black', font=None) img.show()
Debug
Known issues
breakingPilmoji 2.0 changed the API from `Pilmoji.draw_text()` to using a context manager. In version 1.x, you called `pilmoji.draw_text(...)`. In 2.x, you use `with Pilmoji(img) as p: p.text(...)`.
fix
Migrate to the context manager pattern: `with Pilmoji(image) as p: p.text(position, text, fill, font)`.
affects: >=2.0.0
deprecatedThe `Pilmoji` constructor no longer accepts a `draw` parameter. Instead, it works directly with a Pillow Image object.
fix
Pass the Image object directly: `Pilmoji(image)`.
affects: >=2.0.0
gotchaThe `fill` parameter in `text()` only affects non-emoji text. Emoji use their own internal coloring; to override emoji colors, you must set the `emoji_fill` parameter.
fix
Use `p.text((x,y), text, fill='black', emoji_fill='black')` to force emoji to a single color.
affects: all
gotchaWhen using `Pilmoji` without a context manager (calling `__enter__` manually), you must call `close()` to release resources, or use `with` statement.
fix
Always use `with Pilmoji(img) as p:` to ensure proper cleanup.
affects: >=2.0.0
Errors
Common errors & fixes
AttributeError: module 'pilmoji' has no attribute 'Pilmoji'
Wrong import or outdated install (v1 used different export).
fix
Ensure you have pilmoji >=2.0.0 and import: `from pilmoji import Pilmoji`
ImportError: cannot import name 'Twemoji' from 'pilmoji'
Twemoji is in submodule `pilmoji.twemoji`.
fix
Use `from pilmoji.twemoji import Twemoji`
TypeError: text() got an unexpected keyword argument 'fill' (or 'emoji_fill')
Check pilmoji version; in v1.x, the method was `draw_text`.
fix
Upgrade to pilmoji >=2.0.0 and use the context manager: `with Pilmoji(img) as p: p.text(...)`
AttributeError: 'Pilmoji' object has no attribute 'draw_text'
API changed in v2; method `draw_text` no longer exists.
fix
Use the new API: `with Pilmoji(img) as p: p.text(...)`
Upgrade
Version history
2.0.5latest on PyPI · released Jan 29, 2026
Audit
Dependencies
PillowrequiredCore dependency for image processing
requestsoptionalOptional: for downloading emoji images from online sources
Agent activity
2 hits · last 30 days
node
2
Resources
pilmoji — pip install pilmoji · libregistry