A Python package for calculating Benford's Law statistics on images
Project description
benstats
A Python package for calculating Benford's Law statistics on images
Table of Contents
Installation
pip install benstats
Usage
Importing the package
import benstats
Read an image
image = benstats.read("path/to", "image.png")
Supported image formats: bmp, dib, jpeg, jpg, jpe, jp2, png, webp, pbm, pgm, ppm, pxm, pnm, sr, ras, tiff, tif, exr, hdr, pic
Calculate Benford's Law statistics
benstats.benstats(image, channels=['rgb', 'gray'], scale=1, min=0, max=255)
channels
: list of channels to calculate statistics for. Possible values:rgb
,hsv
,gray
,lab
,luv
,xyz
,ycbcr
scale
: scale factor for the image. Ifscale
is less than 1, the image will be downsampled. Ifscale
is greater than 1, the image will be upsampled.min
: new range min to map pixel values into. Default: 0max
: new range max to map pixel values into. Default: 255
Returns a dictionary of channelwise statistics.
Plotting Benford's Law statistics
benstats.benplot(image, channels=['rgb'], scale=1, min=0, max=255)
Same parameters as above.
License
benstats
is distributed under the terms of the MIT license.
Built by @gv-sh @bhaumikdebanshu
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
benstats-0.0.3.tar.gz
(746.0 kB
view details)
Built Distribution
File details
Details for the file benstats-0.0.3.tar.gz
.
File metadata
- Download URL: benstats-0.0.3.tar.gz
- Upload date:
- Size: 746.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.23.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b09d309cb37f25f70080215be5f247a7ab7dfdc53954b16db1ab3d2b5adb431 |
|
MD5 | b67ed09f87bfb243e431f1690d9c2b2b |
|
BLAKE2b-256 | 59088303e191d0f48e7fc52dba784c31242868351d261688c5b570bf8a9008a0 |
File details
Details for the file benstats-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: benstats-0.0.3-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.23.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fa36c1fedabd31978f638f4a3c2577a27db66a2913894be2fb7f523358ceb57 |
|
MD5 | e3a94f2fdcf9e3e3e2f7313bf02e2601 |
|
BLAKE2b-256 | 802e034171aa102d0898de8120b7f7fb9388a1abe367f419e1f2ef48effffaff |