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 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 Mask color (R, G, B)
mask_alpha ❌ (default is 100) int Mask opacity (0~255); 0 is fully opaque, 100 is fully 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

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

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.1.tar.gz (15.8 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.1-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: powerblur-0.1.1.tar.gz
  • Upload date:
  • Size: 15.8 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.1.tar.gz
Algorithm Hash digest
SHA256 579c0a9e71ffd5f28efd48df240998369b5e3a571d11f7d6dd7313edc6b9d7e1
MD5 d350955bf8badf1978875fb242a2e3e4
BLAKE2b-256 195d21b39c8b0149cdbba7436a6eb6e5d3cf25a3ff7373a1d84d4424c990b62a

See more details on using hashes here.

Provenance

The following attestation bundles were made for powerblur-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: powerblur-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.5 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a82e505c4abd1309fc519cabe7105f49afc70b57807a04e51b4b6d86c79b29c8
MD5 6db1ec4390e9f2ccb64fde1fc4f68126
BLAKE2b-256 293be0f12a18f8abcfa531b96da707f5177ea5008d25794191676a24b48ddf83

See more details on using hashes here.

Provenance

The following attestation bundles were made for powerblur-0.1.1-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