diff options
author | 2023-05-09 16:01:01 +0100 | |
---|---|---|
committer | 2023-05-09 16:01:01 +0100 | |
commit | c3e23e60278d34658f801bd7d7ed721d5a272637 (patch) | |
tree | e159a0fae7850d706d713cf2b49dfed2140ce655 /bot/exts/avatar_modification/_effects.py | |
parent | Bump sentry-sdk from 1.21.1 to 1.22.1 (#1273) (diff) | |
parent | Move unshared contants inside modules (diff) |
Merge pull request #1270 from python-discord/migrate-to-ruff
Migrate to ruff
Diffstat (limited to 'bot/exts/avatar_modification/_effects.py')
-rw-r--r-- | bot/exts/avatar_modification/_effects.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bot/exts/avatar_modification/_effects.py b/bot/exts/avatar_modification/_effects.py index f1c2e6d1..fcc62ebb 100644 --- a/bot/exts/avatar_modification/_effects.py +++ b/bot/exts/avatar_modification/_effects.py @@ -1,8 +1,8 @@ import math import random +from collections.abc import Callable from io import BytesIO from pathlib import Path -from typing import Callable, Optional import discord from PIL import Image, ImageDraw, ImageOps @@ -55,7 +55,7 @@ class PfpEffects: @staticmethod def crop_avatar_circle(avatar: Image.Image) -> Image.Image: - """This crops the avatar given into a circle.""" + """Crop the avatar given into a circle.""" mask = Image.new("L", avatar.size, 0) draw = ImageDraw.Draw(mask) draw.ellipse((0, 0) + avatar.size, fill=255) @@ -64,7 +64,7 @@ class PfpEffects: @staticmethod def crop_ring(ring: Image.Image, px: int) -> Image.Image: - """This crops the given ring into a circle.""" + """Crop the given ring into a circle.""" mask = Image.new("L", ring.size, 0) draw = ImageDraw.Draw(mask) draw.ellipse((0, 0) + ring.size, fill=255) @@ -108,7 +108,7 @@ class PfpEffects: return image @staticmethod - def easterify_effect(image: Image.Image, overlay_image: Optional[Image.Image] = None) -> Image.Image: + def easterify_effect(image: Image.Image, overlay_image: Image.Image | None = None) -> Image.Image: """ Applies the easter effect to the given image. |