Skip to main content

PowerBlur is an image blur processing tool based on Pillow...

Project description

PowerBlur

| English | 简体中文 |

📖 Introduction

PowerBlur is an image blurring tool based on Pillow, offering a high degree of freedom. It can achieve effects similar to the frosted glass effect found in systems like Windows/Mac (?).

⬇️ Installation

Make sure to use version 0.0.3 or higher; otherwise, it might not function properly.

pip install PowerBlur

🧑‍💻 Usage

Example Code

from PIL import Image
import PowerBlur

# Load the image
image = Image.open("image.jpg")

# Get image size
width, height = image.size

# Apply the power blur effect
PowerBlur.power_blur(image, (int(width*0.1), int(height*0.1), int(width*0.9), int(height*0.9)))

# Save the blurred image
image.save("output.jpg")

Parameter Explanation

Parameter Required/Default Value Type Description
image ✔️ Image The image to be processed
size ✔️ tuple/list[int, int, int, int] The area of the image to be processed, in the format (x1, y1, x2, y2)
radius ❌ (default is 25) int Corner radius; 0 means no corner radius
mask_fill ❌ (default is (255, 255, 255)) tuple/list[int, int, int] Mask color (R, G, B)
mask_alpha ❌ (default is 100) int Mask opacity (0~255); 0 is fully opaque, 100 is fully transparent
outline_fill ❌ (default is (0, 0, 0)) tuple/list[int, int, int] Outline color (R, G, B)
outline_width ❌ (default is 5) int Outline width
outline_alpha ❌ (default is 128) int Outline opacity (0~255); 0 is fully transparent, 128 is semi-transparent
noise_mean ❌ (default is 0.03) float Gaussian noise mean (0~255)
noise_std ❌ (default is 10) float Gaussian noise standard deviation; 0 means no noise
sigma ❌ (default is 5) float Gaussian blur parameter; 0 means no blur
exposure ❌ (default is 1) float Exposure (0~10); 0 means no exposure
saturation ❌ (default is 1) float Saturation; 0 means no saturation
copy ❌ (default is False) bool Whether to copy the original image without modifying it

Concerned about configuring all these parameters? We’ve prepared some presets for you.

Preset Name Chinese Name Formula
power_blur The default one; nothing much to say, but the author finds it quite nice
blur Basic blur effect, nothing special
aero Windows 7 glass effect, with exposure and saturation effects
acrylic 亚克力 Blur, overlay blend, saturation, color mask, noise texture
mica 云母 Blur, saturation, color mask

✨ Effect Showcase

Original Image

image

Processed Image

image

License

Copyright 2025 Xiaosu.

Distributed under the terms of the Apache 2.0 license.

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

powerblur-0.1.2.tar.gz (16.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

powerblur-0.1.2-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

Details for the file powerblur-0.1.2.tar.gz.

File metadata

  • Download URL: powerblur-0.1.2.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for powerblur-0.1.2.tar.gz
Algorithm Hash digest
SHA256 29f99972cd0485416e102254a259663f8f5e49effb0a5b0bd492b216a22e9ae0
MD5 9831af4288acccc4597006ae45bacac0
BLAKE2b-256 7dd9292d0dbff9253e769c8f05457f26ac58d0a1a6f919ab5ac5d35f51c888e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for powerblur-0.1.2.tar.gz:

Publisher: python-publish.yml on xiaosuyyds/PowerBlur

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file powerblur-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: powerblur-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 14.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for powerblur-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 82a57c67945fa3ac3e75c6b933a110db0b9974a7d15d22373d2069cd3ba9d5a8
MD5 2ce9443e9985a9885e3fd7276c480caf
BLAKE2b-256 d1ec5ce7ca2cc7bbd9099fa4d707b87a7300fbd476d01cfa86b8dc24daf6a7df

See more details on using hashes here.

Provenance

The following attestation bundles were made for powerblur-0.1.2-py3-none-any.whl:

Publisher: python-publish.yml on xiaosuyyds/PowerBlur

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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