Skip to main content

PyPI Latest Release Package Status Downloads License Repository Size

im2dhisteq

This module attempts to enhance contrast of a given image by equalizing its two dimensional histogram. An easy way to enhance quality of a given image is to just equalize its histogram, but despite using minimum resources and a very short process time, there are a lot of drawbacks to it. One of the ways to tackle drawbacks of histogram equalization method is to instead equalize the image's two dimensional histogram, as one dimensional histogram of a given image does not contain the image's contextual information. Tests on a multitude of images has shown, by taking contextual information of an image in addition to the image's histogram into account when attempting to enhance contrast, output images are significantly better in quality in compare to histogram equalizaion and a handful of other known methods.

You can access the article that came up with this method here.

Two Dimensional Histogram

Here is the source code for the im2dhist python library with a short description on how it's done.

Installation

Run the following to install:

pip install im2dhisteq

Usage

For images

im2dhisteq --input 'cloudy-day.jpg' --output 'assets/cloudy-day-2dhisteq.jpg' --w 6

For videos

vid2dhisteq --input 'video-input.mp4' --output 'video-output-enhanced.mp4' --w 6

Speed up

The speed of the program can be significantly increased if the go library lib-im2dhist.go in src/go_libs in the package is compiled and moved to a dir in the system path. To compile, first make sure go is installed on your system. Then run

go mod init lib-im2dhist.go
go mod tidy

followed by running the script make-library.

Download binary

Instead of compiling the go library lib-im2dhist.go, you can download the library based on your system configuration:

Showcase

Metadata

Release files for im2dhisteq 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for im2dhisteq 1.1.0
File Size Uploaded
im2dhisteq-1.1.0.tar.gz 22.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for im2dhisteq 1.1.0
File Interpreter ABI Platform
im2dhisteq-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 43.3 kB

Release files / im2dhisteq-1.1.0.tar.gz

Download URL im2dhisteq-1.1.0.tar.gz
Size 22.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f6aa10f15ca22d3761774559c25c59218907d6a3874b00e68636549a3cc36810
BLAKE2b-256 checksum
How to use checksums
147c04a8ed2691856b333d2bb7a664f6db0ede2dd7b58421476aa2d34b6bb3dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.8

Release files / im2dhisteq-1.1.0-py3-none-any.whl

Download URL im2dhisteq-1.1.0-py3-none-any.whl
Size 21.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
330bc853d5236787f042cc66a210a2773f64bbab99767f1a4696a71a6058ce8d
BLAKE2b-256 checksum
How to use checksums
03d064476630ad6ff825daf9d6d238fd6a964e0549bd964f1e2a63afb2e1a115
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.8

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.9

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.0

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page