What it does
- Splits each image into square cells based on a chosen pixel cell size.
- Computes non-black pixel percentage in each grid cell.
- Applies a threshold to classify each cell as active/inactive.
- Normalises the final score to a 0–100 scale for easy comparison.
- Exports batch results to CSV for downstream analysis.
Quick start
Install
pip install pillow numpy
Run GUI
python gui.py
# or
python3 gui.py
Run CLI
python run.py --cell-size 50 --threshold 50
# or
python3 run.py --cell-size 50 --threshold 50
Workflow
- Select a folder of images.
- Choose valid cell size and threshold.
- Optionally provide
mask.png(white excludes, black keeps). - Process images and export a
results_<cell>px_<threshold>.csvfile.
Example output
If 30 out of 100 cells pass threshold, the normalised score is 30.0.
CSV columns: Image Name, Normalised Value
Sample heatmaps
Use cases
- Educational demos of grid-based image quantification.
- Exploratory visual data scoring for research workflows.
- Comparing pattern intensity across image sets.