Effects¶
Effect classes for the Editor.effect() method.
- class easy_pil.effect.Bloom(threshold: int = 200, radius: int = 15, intensity: float = 0.4)¶
Make bright areas glow outward.
- Parameters:
threshold (int, optional) – Brightness threshold 0-255, by default 200
radius (int, optional) – Glow spread radius, by default 15
intensity (float, optional) – Glow strength 0-1, by default 0.4
- apply(image: Image) Image¶
Apply effect to image, return modified copy.
- class easy_pil.effect.Blur(amount: float = 1, *, mode: str = 'gaussian')¶
Apply box or gaussian blur.
- Parameters:
amount (float, optional) – Blur radius, by default 1
mode (Literal["box", "gaussian"], optional) – Blur type, by default “gaussian”
- apply(image: Image) Image¶
Apply effect to image, return modified copy.
- class easy_pil.effect.Cartoon(colors: int = 5, edge_thickness: int = 1)¶
Cartoon effect with quantized colors and bold edges.
- Parameters:
colors (int, optional) – Bits per channel 1-8, by default 5
edge_thickness (int, optional) – Edge line width, by default 1
- apply(image: Image) Image¶
Apply effect to image, return modified copy.
- class easy_pil.effect.ChromaticAberration(offset: int = 4)¶
RGB channel offset for glitch/aberration effect.
- Parameters:
offset (int, optional) – Pixel offset between channels, by default 4
- apply(image: Image) Image¶
Apply effect to image, return modified copy.
- class easy_pil.effect.ColorOverlay(color: int | str | tuple[int, int, int] | tuple[int, int, int, int], alpha: float = 0.5)¶
Overlay solid color with transparency over image.
- Parameters:
color (Color) – Overlay color.
alpha (float, optional) – Opacity 0-1, by default 0.5. Ignored if color includes alpha.
- apply(image: Image) Image¶
Apply effect to image, return modified copy.
- class easy_pil.effect.Contour¶
Find image contours. Built-in Pillow filter.
- apply(image: Image) Image¶
Apply effect to image, return modified copy.
- class easy_pil.effect.Dither(threshold: int = 128)¶
Ordered Bayer dithering for retro 1-bit look.
- Parameters:
threshold (int, optional) – Brightness threshold 0-255, by default 128
- apply(image: Image) Image¶
Apply effect to image, return modified copy.
- class easy_pil.effect.DropShadow(offset: tuple[int, int] = (5, 5), blur_radius: int = 10, color: int | str | tuple[int, int, int] | tuple[int, int, int, int] = (0, 0, 0), alpha: float = 0.5)¶
Add drop shadow behind image content.
- Parameters:
offset (tuple[int, int], optional) – Shadow offset (x, y), by default (5, 5)
blur_radius (int, optional) – Blur radius for shadow softness, by default 10
color (Color, optional) – Shadow color, by default (0, 0, 0)
alpha (float, optional) – Shadow opacity 0-1, by default 0.5
- apply(image: Image) Image¶
Apply effect to image, return modified copy.
- class easy_pil.effect.Duotone(dark_color: int | str | tuple[int, int, int] | tuple[int, int, int, int] = (10, 10, 50), light_color: int | str | tuple[int, int, int] | tuple[int, int, int, int] = (255, 240, 200))¶
Map shadows to one color and highlights to another.
- Parameters:
dark_color (Color, optional) – Color for shadows, by default (10, 10, 50)
light_color (Color, optional) – Color for highlights, by default (255, 240, 200)
- apply(image: Image) Image¶
Apply effect to image, return modified copy.
- class easy_pil.effect.EdgeEnhance(amount: int = 1)¶
Enhance image edges.
- Parameters:
amount (int, optional) – Number of enhancement passes, by default 1
- apply(image: Image) Image¶
Apply effect to image, return modified copy.
- class easy_pil.effect.EdgeGlow(color: int | str | tuple[int, int, int] | tuple[int, int, int, int] = 'cyan', intensity: float = 0.8)¶
Neon-like edge highlight.
- Parameters:
color (Color, optional) – Edge glow color, by default “cyan”
intensity (float, optional) – Glow strength 0-1, by default 0.8
- apply(image: Image) Image¶
Apply effect to image, return modified copy.
- class easy_pil.effect.Emboss¶
Emboss effect. Built-in Pillow filter.
- apply(image: Image) Image¶
Apply effect to image, return modified copy.
- class easy_pil.effect.Glitch(amount: float = 0.5)¶
VHS-style glitch effect with strip offsets and channel bleed.
- Parameters:
amount (float, optional) – Glitch intensity 0-1, by default 0.5
- apply(image: Image) Image¶
Apply effect to image, return modified copy.
- class easy_pil.effect.Glow(radius: int = 10, color: int | str | tuple[int, int, int] | tuple[int, int, int, int] = 'white', alpha: float = 0.5)¶
Add outer glow behind image content.
- Parameters:
radius (int, optional) – Glow spread radius, by default 10
color (Color, optional) – Glow color, by default “white”
alpha (float, optional) – Glow opacity 0-1, by default 0.5
- apply(image: Image) Image¶
Apply effect to image, return modified copy.
- class easy_pil.effect.Gradient(colors: list[int | str | tuple[int, int, int] | tuple[int, int, int, int]], direction: str = 'horizontal')¶
Fill image with linear gradient.
- Parameters:
colors (list[Color]) – List of colors for gradient stops. Must be at least 2.
direction (str, optional) – Gradient direction: “horizontal”, “vertical”, or “diagonal”, by default “horizontal”
- apply(image: Image) Image¶
Apply effect to image, return modified copy.
- class easy_pil.effect.Grayscale¶
Convert image to grayscale.
- apply(image: Image) Image¶
Apply effect to image, return modified copy.
- class easy_pil.effect.Halftone(dot_size: int = 8, angle: float = 45.0)¶
Comic-book dot pattern effect.
- Parameters:
dot_size (int, optional) – Size of halftone dots, by default 8
angle (float, optional) – Screen angle in degrees, by default 45.0
- apply(image: Image) Image¶
Apply effect to image, return modified copy.
- class easy_pil.effect.Invert¶
Invert image colors.
- apply(image: Image) Image¶
Apply effect to image, return modified copy.
- class easy_pil.effect.Kaleidoscope(segments: int = 8)¶
Mirror-tile symmetry effect.
- Parameters:
segments (int, optional) – Number of reflective segments, by default 8
- apply(image: Image) Image¶
Apply effect to image, return modified copy.
- class easy_pil.effect.Neon(color: int | str | tuple[int, int, int] | tuple[int, int, int, int] = 'cyan', glow_radius: int = 5)¶
Cyberpunk neon edge glow on dark background.
- Parameters:
color (Color, optional) – Glow color, by default “cyan”
glow_radius (int, optional) – Glow spread, by default 5
- apply(image: Image) Image¶
Apply effect to image, return modified copy.
- class easy_pil.effect.Noise(intensity: float = 0.15, monochrome: bool = True)¶
Add film grain / noise overlay.
- Parameters:
intensity (float, optional) – Noise strength 0-1, by default 0.15
monochrome (bool, optional) – Single-channel noise vs color noise, by default True
- apply(image: Image) Image¶
Apply effect to image, return modified copy.
- class easy_pil.effect.OilPaint(radius: int = 3)¶
Simulate oil painting effect.
- Parameters:
radius (int, optional) – Brush size, by default 3
- apply(image: Image) Image¶
Apply effect to image, return modified copy.
- class easy_pil.effect.PixelSort(direction: str = 'horizontal')¶
Glitch-art pixel sorting effect.
- Parameters:
direction (str, optional) – Sort direction: “horizontal” or “vertical”, by default “horizontal”
- apply(image: Image) Image¶
Apply effect to image, return modified copy.
- class easy_pil.effect.Pixelate(pixel_size: int = 8)¶
Pixelate entire image.
- Parameters:
pixel_size (int, optional) – Size of pixel blocks, by default 8
- apply(image: Image) Image¶
Apply effect to image, return modified copy.
- class easy_pil.effect.PixelateRegion(box: tuple[int, int, int, int], pixel_size: int = 8)¶
Pixelate a specific region of the image.
- Parameters:
box (tuple[int, int, int, int]) – Region to pixelate (left, top, right, bottom).
pixel_size (int, optional) – Size of each pixel block, by default 8
- apply(image: Image) Image¶
Apply effect to image, return modified copy.
- class easy_pil.effect.Posterize(bits: int = 4)¶
Reduce color levels (posterization effect).
- Parameters:
bits (int, optional) – Bits per channel (1-8), lower = more posterized, by default 4
- apply(image: Image) Image¶
Apply effect to image, return modified copy.
- class easy_pil.effect.Ripple(amplitude: int = 5, period: int = 50)¶
Water-like wave distortion.
- Parameters:
amplitude (int, optional) – Wave height in pixels, by default 5
period (int, optional) – Wave length in pixels, by default 50
- apply(image: Image) Image¶
Apply effect to image, return modified copy.
- class easy_pil.effect.Scanlines(size: int = 3, opacity: float = 0.3)¶
CRT scanline overlay.
- Parameters:
size (int, optional) – Scanline thickness, by default 3
opacity (float, optional) – Darkness 0-1, by default 0.3
- apply(image: Image) Image¶
Apply effect to image, return modified copy.
- class easy_pil.effect.Sepia¶
Apply sepia tone effect.
- apply(image: Image) Image¶
Apply effect to image, return modified copy.
- class easy_pil.effect.Sharpen(amount: int = 1)¶
Sharpen image.
- Parameters:
amount (int, optional) – Number of sharpen passes, by default 1
- apply(image: Image) Image¶
Apply effect to image, return modified copy.
- class easy_pil.effect.Sketch(blur: int = 5)¶
Pencil drawing effect using dodge blend.
- Parameters:
blur (int, optional) – Stroke softness, by default 5
- apply(image: Image) Image¶
Apply effect to image, return modified copy.
- class easy_pil.effect.Smooth(amount: int = 1)¶
Smooth image.
- Parameters:
amount (int, optional) – Number of smoothing passes, by default 1
- apply(image: Image) Image¶
Apply effect to image, return modified copy.
- class easy_pil.effect.Solarize(threshold: int = 128)¶
Invert pixels above brightness threshold.
- Parameters:
threshold (int, optional) – Brightness cutoff 0-255, by default 128
- apply(image: Image) Image¶
Apply effect to image, return modified copy.
- class easy_pil.effect.Thermal¶
Map brightness to thermal/infrared color ramp.
- apply(image: Image) Image¶
Apply effect to image, return modified copy.
- class easy_pil.effect.Threshold(cutoff: int = 128)¶
Convert image to pure black and white at cutoff.
- Parameters:
cutoff (int, optional) – Brightness cutoff 0-255, by default 128
- apply(image: Image) Image¶
Apply effect to image, return modified copy.
- class easy_pil.effect.TiltShift(blur_strength: int = 10, focus_center: float = 0.5, focus_width: float = 0.3)¶
Gradient blur simulating shallow depth of field.
- Parameters:
blur_strength (int, optional) – Blur amount at edges, by default 10
focus_center (float, optional) – Vertical center of focus 0-1, by default 0.5
focus_width (float, optional) – Height of sharp zone 0-1, by default 0.3
- apply(image: Image) Image¶
Apply effect to image, return modified copy.
- class easy_pil.effect.Vignette(radius: float = 100, color: int | str | tuple[int, int, int] | tuple[int, int, int, int] = (0, 0, 0), feather: float = 50)¶
Darken edges of image with radial gradient.
- Parameters:
radius (float, optional) – Radius of protected center area, by default 100
color (Color, optional) – Vignette color, by default (0, 0, 0)
feather (float, optional) – Blur radius for edge softness, by default 50
- apply(image: Image) Image¶
Apply effect to image, return modified copy.
- class easy_pil.effect.Vortex(strength: float = 3.0, radius: float | None = None)¶
Swirl distortion effect.
- Parameters:
strength (float, optional) – Swirl intensity, by default 3.0
radius (float, optional) – Swirl radius in pixels. Defaults to half the image.
- apply(image: Image) Image¶
Apply effect to image, return modified copy.