Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

render emoji in Pillow #85

Open
guitar9 opened this issue Sep 11, 2018 · 6 comments
Open

render emoji in Pillow #85

guitar9 opened this issue Sep 11, 2018 · 6 comments

Comments

@guitar9
Copy link

guitar9 commented Sep 11, 2018

is it possible to render Text with emoji in an Image with Pillow?

@giff-h
Copy link

giff-h commented Sep 11, 2018

Perhaps this may help? python-pillow/Pillow#1774

@guitar9
Copy link
Author

guitar9 commented Sep 12, 2018 via email

@alexislg2
Copy link

where you able to find a solution?

@guitar9
Copy link
Author

guitar9 commented Jan 26, 2019 via email

@kubinka0505
Copy link

kubinka0505 commented Oct 6, 2021

is it possible to render Text with emoji in an Image with Pillow?

I've created auepa for it, but emojicdn's much faster

from os import *
from emoji import *
from PIL import Image
from requests import get
del open
chdir(path.expanduser("~/Desktop"))

#---#

Emoji = ":snake:"
Style = "twitter"	# http://github.com/benborgers/emojicdn#emoji-style

#---# 

im = Image.open(
    get(
        "https://emojicdn.elk.sh/{0}?style={1}".format(
            emojize(Emoji.lower(), use_aliases = 1),
            ("?style=" + Style.lower()) if Style else ""
        ),
        stream = 1).raw
    )
)
im = im.crop(im.getbbox())
im.save(demojize(Emoji[1:-1]) + ".png")
im.show()

@cvzi
Copy link
Contributor

cvzi commented Feb 1, 2023

There is a library for doing this that supports different emoji styles:
https://github.com/jay3332/pilmoji -- https://pypi.org/project/pilmoji/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants