Skip to main content

is_page_empty

A simple package/script that checks whether a given image file is empty.

Install it with one of the optional dependencies skimage, imageio, or pil or provide that skimage, imageio, or pillow are installed.

Then you can check whether an image file is empty using the commandline:

if is_page_empty some_image.png; then echo "Yes, it's empty"; else echo "No, it's not empty."; fi

Or you can use the package to check programmatically

import is_page_empty
if is_empty('path/to/image/file.png'):
    print("That file is empty.")

The script simply cuts the page into small squares, counts the number of pixels below a certain threshold in each, and compares the sum of those numbers in the squares with the highest numbers to a cutoff threshold.

This has been very robust, in my experience, for scanned text; in particular in double-sided prints, where some of the print on the other side may shine through, and in pages with punched holes, which are rendered black in the print.

Metadata

Release files for is-page-empty 1.0.4

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

Source distribution (sdist)

Source distribution for is-page-empty 1.0.4
File Size Uploaded Provenance
is_page_empty-1.0.4.tar.gz 4.9 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for is-page-empty 1.0.4
File Interpreter ABI Platform
is_page_empty-1.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 8.5 kB

Release files / is_page_empty-1.0.4.tar.gz

Download URL is_page_empty-1.0.4.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
390755e3ca9c599cf43304fc7a63366d3b9f92963791b1a089f023af5078cac5
BLAKE2b-256 checksum
How to use checksums
db240b61b707d211eb5c3978e6382275ca7cafedc37688f246633efa8bd38d69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.

Transparency log

Release files / is_page_empty-1.0.4-py3-none-any.whl

Download URL is_page_empty-1.0.4-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c4cf8d78cc844276ed0be3b49badaa54dbbb0824a90f8920db7041b88a97ae1e
BLAKE2b-256 checksum
How to use checksums
f3c86f0fa9d46a307c243398c27b75ee6386605833757d89660057c2459ebf43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.

Transparency log

Security for is-page-empty 1.0.4

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for is_page_empty-1.0.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.

Transparency log

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.4 This release

2 release files Full 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