Skip to main content

benstats

A Python package for calculating Benford's Law statistics on images

PyPI - Version PyPI - Python Version


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. If scale is less than 1, the image will be downsampled. If scale is greater than 1, the image will be upsampled.
  • min: new range min to map pixel values into. Default: 0
  • max: 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

Metadata

Release files for benstats 0.0.3

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

Source distribution (sdist)

Source distribution for benstats 0.0.3
File Size Uploaded Provenance
benstats-0.0.3.tar.gz 746.0 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 751.2 kB

Release files / benstats-0.0.3.tar.gz

Download URL benstats-0.0.3.tar.gz
Size 746.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5b09d309cb37f25f70080215be5f247a7ab7dfdc53954b16db1ab3d2b5adb431
BLAKE2b-256 checksum
How to use checksums
59088303e191d0f48e7fc52dba784c31242868351d261688c5b570bf8a9008a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.23.0

Release files / benstats-0.0.3-py3-none-any.whl

Download URL benstats-0.0.3-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4fa36c1fedabd31978f638f4a3c2577a27db66a2913894be2fb7f523358ceb57
BLAKE2b-256 checksum
How to use checksums
802e034171aa102d0898de8120b7f7fb9388a1abe367f419e1f2ef48effffaff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.23.0

Security for benstats 0.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files No provenance

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