aioEasyPillow
A python library based on easy-pil and Pillow to easily edit/modify images.
Installation
Python 3.8 or above is required
To install the library directly from PyPI you can just run the following command:
# Linux/macOS
python3 -m pip install -U "discord.py[voice]"
# Windows
py -3 -m pip install -U discord.py[voice]
Quick Example
import asyncio
from aioEasyPillow import Editor, Canvas, Font
async def main():
blank = Canvas((200, 100), 'black')
editor = Editor(blank)
font = Font.poppins('bold', 200)
await editor.text((20,20), 'Quick Example', font)
await editor.save('example.png', 'PNG')
await editor.show()
asyncio.run(main())
Discord Bot Example
import discord
from discord.ext import commands
from aioEasyPillow import Editor, Canvas, Font, load_image
intents = discord.Intents.default()
intents.members = True # don't forget to activate this in the dev portal
# You can of course also use the discord.Bot() or commands.Bot() class
bot = commands.Bot(command_prefix='!', intents=intents)
@bot.command()
async def circle(ctx):
# Load the image using `load_image`
image = await load_image(ctx.author.display_avatar.url)
# Initialize the editor and pass image as a parameter
editor = Editor(image)
# Simply circle the image
await editor.circle_image()
# Creating a discord.File object from the editors image_bytes, the image must not be saved
file = discord.File(fp=editor.image_bytes, filename='circle.png')
await ctx.send('Your circled imagavatare', file=file)
bot.run("TOKEN")
Release files for aioEasyPillow 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| aioEasyPillow-0.0.3.tar.gz | 892.9 kB | Details |
Release files / aioEasyPillow-0.0.3.tar.gz
| Download URL | aioEasyPillow-0.0.3.tar.gz |
|---|---|
| Size | 892.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
54194bb2c416bd5f725d60471ff356150690c78785464d36f9d7c2bcfb5ed479
|
|
BLAKE2b-256 checksum How to use checksums |
440795153cc7de59a2aeb3b871f4756023f92d7d8aee0f5e392a272d6959aa20
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.7
|