Skip to main content

Async working easy to use Pillow Library.

Project description

aioEasyPillow

PyPI

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")

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

aioEasyPillow-0.0.2.tar.gz (892.1 kB view details)

Uploaded Source

File details

Details for the file aioEasyPillow-0.0.2.tar.gz.

File metadata

  • Download URL: aioEasyPillow-0.0.2.tar.gz
  • Upload date:
  • Size: 892.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.7

File hashes

Hashes for aioEasyPillow-0.0.2.tar.gz
Algorithm Hash digest
SHA256 8610c5f0c6a004a72a469fde93d399938d0f87b7be9bdea4c84587f0db7c356a
MD5 fc09acf24b7b2bbc40ff92c602f1c4f3
BLAKE2b-256 5aafa78ad6491a2f70099c77b237877a39e11bcb176492218cf8230251449fbd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page