A Python library built on top of PIL to easily edit/modify images
Project description
Easy PIL
A Python library built on top of Pillow to easily edit/modify images.
Installation
pip install easy-pil
Requires Python 3.11 or higher.
Quick Example
from easy_pil import Editor, Canvas
canvas = Canvas(width=500, height=500)
editor = Editor(canvas)
editor.text((10, 10), "Hello World")
editor.show() # or .save("output.png")
Effects System
Apply 38+ effects using the unified effect() method with Effect classes:
from easy_pil import Editor, load_image
from easy_pil import Vignette, Glow, Gradient, Blur, Sepia, PixelSort
editor = Editor(load_image("image.jpg"))
# Single effect
editor.effect(Vignette(radius=120, feather=60))
# Chain multiple effects
editor.effect(Blur(amount=2)).effect(Sepia()).save("out.png")
All Effects
| Category | Effects |
|---|---|
| Blur & Filters | Blur (box/gaussian), Contour, Emboss, EdgeEnhance, Sharpen, Smooth, Pixelate |
| Color | Grayscale, Sepia, Invert, Posterize, Solarize, Threshold, Duotone |
| Overlay | ColorOverlay, Gradient, Vignette, Noise, Scanlines, Halftone, Dither |
| Lighting | Glow, Bloom, Neon, EdgeGlow |
| Shadow | DropShadow |
| Distort | Ripple, Vortex, Glitch, PixelSort, Kaleidoscope |
| Artistic | OilPaint, TiltShift, Sketch, Cartoon, Thermal |
| Region | PixelateRegion |
Each Effect class has configurable parameters — see the API Reference for details.
Text Features
from easy_pil import Editor, Font, Text
editor = Editor("image.jpg")
# Simple text
editor.text((10, 10), "Hello", font=Font.poppins(size=32), color="white")
# Rich text with mixed colors/fonts
editor.rich_text((10, 50), [
Text("Hello", Font.poppins(size=32), "red"),
Text("World", Font.poppins(size=24), "blue"),
])
# Auto-wrapping text box
editor.text_box((10, 100), "Long text that wraps automatically...",
font=Font.poppins(size=20), max_width=400)
# Text with drop shadow
editor.text_shadow((200, 300), "Hello", font=Font.poppins(size=40),
shadow_color="black", shadow_offset=(3, 3))
# Auto-fit text to width
font = editor.fit_text("Title", max_width=300, font_path="font.ttf")
editor.text((10, 10), "Title", font=font)
# Centered text
editor.centered_text((300, 400), "Centered", font=Font.poppins(size=30), align="center")
Drawing Shapes
editor.rectangle((10, 10), width=100, height=50, fill="red")
editor.ellipse((150, 10), width=80, height=80, outline="blue", outline_width=3)
editor.bar((10, 70), width=200, height=20, color="green")
editor.rounded_bar((10, 100), width=200, height=20, color="purple", radius=10)
editor.polygon([(300, 10), (350, 50), (250, 50)], fill="orange")
editor.arc((10, 150), width=100, height=100, start=0, end=180, fill="pink", width=3)
editor.line((10, 300), (200, 350), width=4, color="black")
editor.donut((300, 300), inner_radius=30, outer_radius=60, fill="teal")
Image Adjustments
editor.resize((400, 400))
editor.rotate(45, expand=True)
editor.crop((50, 50, 200, 200))
editor.flip(horizontal=True)
editor.thumbnail((200, 200))
editor.contrast(1.5)
editor.brightness(1.2)
editor.saturation(0.8)
editor.invert()
editor.blur(mode="gaussian", amount=5)
Compositing
editor.blend(other_image, alpha=0.5)
editor.paste(overlay, position=(50, 50))
editor.mask(mask_image, invert=False)
editor.compose([img1, img2, img3], direction="vertical", align="center")
editor.rounded_corners(radius=20)
editor.circle_image()
editor.add_border(thickness=5, color="black")
Image I/O
editor = Editor.open("image.png")
editor.save("output.png")
editor.show()
editor.to_bytes(fmt="PNG") # -> bytes
Async Support
from easy_pil import load_image_async
img = await load_image_async("https://example.com/image.png")
GIF Editing
from easy_pil import GifEditor
gif = GifEditor("animation.gif")
for frame in gif.frames:
frame.rotate(90)
gif.save("rotated.gif")
Documentation
Support
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file easy_pil-0.4.3.tar.gz.
File metadata
- Download URL: easy_pil-0.4.3.tar.gz
- Upload date:
- Size: 2.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
42be7e44508d73e98707fcae3f19f54f2ae8894bd6f92206f77c5c4bf71b616e
|
|
| MD5 |
b39137c90527ceb05925bc971118fbba
|
|
| BLAKE2b-256 |
c6bf11d27d228abe5b66c446039f1c69fa926cf0724557974f98a1f335cef070
|
Provenance
The following attestation bundles were made for easy_pil-0.4.3.tar.gz:
Publisher:
publish.yml on shahriyardx/easy-pil
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
easy_pil-0.4.3.tar.gz -
Subject digest:
42be7e44508d73e98707fcae3f19f54f2ae8894bd6f92206f77c5c4bf71b616e - Sigstore transparency entry: 1454332794
- Sigstore integration time:
-
Permalink:
shahriyardx/easy-pil@91d5270469118190f3462cbc0118383b4d473e65 -
Branch / Tag:
refs/tags/v0.4.3 - Owner: https://github.com/shahriyardx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@91d5270469118190f3462cbc0118383b4d473e65 -
Trigger Event:
release
-
Statement type:
File details
Details for the file easy_pil-0.4.3-py3-none-any.whl.
File metadata
- Download URL: easy_pil-0.4.3-py3-none-any.whl
- Upload date:
- Size: 906.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c6bab322d5bac91b903e53d588d151228f214562f926d5bf1a9e3cf3e38248d
|
|
| MD5 |
25cb63800156e8b8471c6d43f30cf845
|
|
| BLAKE2b-256 |
01a771efc064befd7afa8e648e41b23f083d9f8c6d4e37486be2ac49c27bed75
|
Provenance
The following attestation bundles were made for easy_pil-0.4.3-py3-none-any.whl:
Publisher:
publish.yml on shahriyardx/easy-pil
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
easy_pil-0.4.3-py3-none-any.whl -
Subject digest:
9c6bab322d5bac91b903e53d588d151228f214562f926d5bf1a9e3cf3e38248d - Sigstore transparency entry: 1454332877
- Sigstore integration time:
-
Permalink:
shahriyardx/easy-pil@91d5270469118190f3462cbc0118383b4d473e65 -
Branch / Tag:
refs/tags/v0.4.3 - Owner: https://github.com/shahriyardx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@91d5270469118190f3462cbc0118383b4d473e65 -
Trigger Event:
release
-
Statement type: