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

Uploaded Python 3

File details

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

File metadata

  • Download URL: powerblur-0.1.0.tar.gz
  • Upload date:
  • Size: 15.9 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.0.tar.gz
Algorithm Hash digest
SHA256 29131cf5dd800d8948c296ffdb3eea3b1917ea0e1f9583c67d55c0763c796f7c
MD5 db330655d7bad26245e077d919fef5fe
BLAKE2b-256 83acb4dbcdff4fa40eea336b38efbe9cc127108cb33b7928d5238eba2159c0a7

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: powerblur-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2157804ae1cece59af32910ca1acec814ae4a54725bce82414351b083dce97d1
MD5 a628bab302af41179ab3145421d7ee17
BLAKE2b-256 32da60ef436e65924af440d0874773d6f640aac242425a13995e71135fece53c

See more details on using hashes here.

Provenance

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