Image threshold analysis tool for measuring coverage
Project description
Note
The project is currently undergoing transition from pip-based build to uv-based build. Therefore, there may be problems with some installation instructions.
DarkCoverage
DarkCoverage is an image analysis tool that helps you measure and visualize the coverage of dark or light areas in images using customizable thresholds and a grid-based approach.
Its usage is simple: Just run the program, load the image, and then use the sliders to specify appropriate threshold for each area.
Features
- Load and analyze images with customizable number of rows and columns
- Set individual thresholds for each grid cell
- Color dark or light areas based on threshold values
- View real-time coverage percentage for each cell and overall image
- Compare with original image reference
- Save processed images
Installation and Usage
With pip
Installation:
pip install darkcoverage
Usage:
darkcoverage
or if Python is not included to path
darkcoverage.main
With uv
Installation:
First, install uv if you haven't already (see uv docs for more information)
Then install DarkCoverage:
uv add darkcoverage
Or install globally with uvx:
uvx darkcoverage
Usage:
# If installed with uv add
uv run darkcoverage
# If installed with uvx
uvx darkcoverage
From Source
With pip
Installation:
-
Clone the repository:
git clone https://github.com/TZ387/darkcoverage.git cd darkcoverage
-
Install the package:
pip install -e .
Usage:
python -m darkcoverage.main
With uv
Installation:
-
Clone the repository:
git clone https://github.com/TZ387/darkcoverage.git cd darkcoverage
-
Install dependencies and set up the project:
uv sync
Usage:
uv run python -m darkcoverage.main
Basic Workflow
- Click "Load Image" to open an image file (such as Example.jpg in the main folder).
- Adjust the number of rows and columns using the row and column inputs in the sliders window
- Set threshold values for each cell using the sliders
- Toggle between "Color Dark Parts" and "Color Light Parts" to choose which areas to highlight
- View the coverage percentages for each cell and the total image
- Save the processed image with "Save Image"
In case something goes wrong, you can use reset image option.
Project Structure
DarkCoverage/
├── src/
│ └── darkcoverage/
│ ├── __init__.py
│ ├── main.py
│ ├── gui.py
│ ├── image_processing.py
│ └── widgets/
│ ├── __init__.py
│ ├── image_label.py
│ ├── reference_window.py
│ └── sliders_window.py
├── .gitignore
├── uv.lock
├── LICENSE
├── pyproject.toml
├── README.md
├── Demonstration.png
└── Example.jpg
Requirements
- Python 3.8+
- PySide6
- Pillow
- NumPy
License
This project is licensed under the MIT License - see the LICENSE file for details.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file darkcoverage-0.2.1.tar.gz.
File metadata
- Download URL: darkcoverage-0.2.1.tar.gz
- Upload date:
- Size: 965.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9d8bbf4a06c1d38b286f0a96f1aae79978562de251e983ac347c32987290b01
|
|
| MD5 |
3004d68844916964f07ea1ed895f8b18
|
|
| BLAKE2b-256 |
4d3ec1ff6eac55b123e0d64a319c60d3fa91b9a0cde47e83532d437857ff5768
|
File details
Details for the file darkcoverage-0.2.1-py3-none-any.whl.
File metadata
- Download URL: darkcoverage-0.2.1-py3-none-any.whl
- Upload date:
- Size: 11.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0842233d43f94abc91b662333bbd0a96551fbd98d524d6c59d28e21674662131
|
|
| MD5 |
aa5d53c9466b6f9fb580c0146ecadfb2
|
|
| BLAKE2b-256 |
75c7f10e08e8501d7bff721cf006553520ff2471d1aeb3dc81acbeae23a7bb70
|