Skip to main content

A Python implementation of https://doi.org/10.1007/s41095-021-0232-x

Project description

This repository features an implementation of the algorithm proposed in "Low and non-uniform illumination color image enhancement using weighted guided image filtering" by Mu, Q., Wang, X., Wei, Y. et al. (2021)

Installation

pip install illumination_using_wgif

Usage

from PIL import Image
from illumination_using_wgif import illuminate

# load_image
image = Image.open("./<YOUR_IMAGE_HERE>")

rgb_image_data = np.reshape(image.getdata(), (image.size[1], image.size[0], 3))
greyscale_image_data = np.reshape(image.convert('L').getdata(), (image.size[1], image.size[0]))

# greyscale
illuminated_greyscale_data = illuminate(rgb_image_data)
# or: illuminated_greyscale_data = illuminate(greyscale_image_data)
illuminated_greyscale = Image.fromarray(illuminated_greyscale_data)

# linear color restoration
illuminated_linear_data = illuminate(rgb_image_data, 'linear')
illuminated_linear = Image.fromarray(illuminated_linear_data)

# hls color restoration
illuminated_hls_data = illuminate(rgb_image_data, 'hls')
illuminated_hls = Image.fromarray(illuminated_hls_data)

Github

For more info see https://github.com/muelphil/illumination_using_wgif

Notes

The color restoration is terribly slow as of now, could be optimized

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

illumination_using_wgif-0.1.0.tar.gz (10.2 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: illumination_using_wgif-0.1.0.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for illumination_using_wgif-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dfa44ae4eb59e3d86c179672d819b5f61e039ab87722eea720b48aac7215b25d
MD5 8482d6767bf0bd5045dee15b2c612c8b
BLAKE2b-256 c6312205c19db706c93fc2b12fd4a3ec43603b55e96f54d2daf4c93bfcb12f79

See more details on using hashes here.

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