Go to file
lm d49cd08c23 Ignore root __pycache__ directory 2025-10-17 09:05:11 +02:00
app Refine UI layout and theme behavior 2025-10-15 20:18:21 +02:00
images Initial project structure 2025-10-15 18:03:07 +02:00
.gitignore Ignore root __pycache__ directory 2025-10-17 09:05:11 +02:00
README.md Adopt uv-based workflow 2025-10-17 08:58:22 +02:00
config.toml Refactor app layout and load defaults from config 2025-10-15 18:16:18 +02:00
main.py Refactor app layout and load defaults from config 2025-10-15 18:16:18 +02:00
pyproject.toml Adopt uv-based workflow 2025-10-17 08:58:22 +02:00

README.md

ColorCalc

ColorCalc is a small Tkinter tool for analysing colour ranges in images. You load a picture, pick or click a reference colour, adjust hue/saturation/value sliders, and the app marks matching pixels while showing quick stats.

Features

  • Two synced previews (original + overlay)
  • Hue/Sat/Value sliders with presets and image colour picker
  • Exclusion rectangles to ignore regions
  • Theme toggle (light/dark) with rounded toolbar buttons
  • Quick overlay export (PNG) and optional defaults via config.toml

Requirements

  • Python 3.11+ (3.10 works with tomli)
  • uv for dependency management
  • Tkinter (install separately on some Linux distros)

Setup with uv

git clone https://github.com/<your-org>/ColorCalc.git
cd ColorCalc
uv venv
source .venv/bin/activate         # Windows: .venv\Scripts\activate
uv pip sync                       # installs Pillow + optional deps from pyproject
uv run colorcalc                  # launches the GUI

To include the optional ttkbootstrap theme pack:

uv pip install '.[ui]'

Workflow

  1. Load an image (📂).
  2. Pick a colour (🎨 dialog, 🖱️ image click, or preset swatch).
  3. Finetune sliders; watch the overlay update on the right.
  4. Draw exclusions with right drag; reset or save when ready.

Config Defaults

Optional config.toml:

[defaults]
hue_min = 250.0
hue_max = 310.0
sat_min = 15.0
val_min = 15.0
val_max = 100.0
alpha = 120

Project Layout

app/
  app.py          # main app assembly
  gui/            # UI, theme, picker mixins
  logic/          # image ops, defaults, reset
config.toml       # optional defaults
main.py           # entry point

Development

  • Quick check: uv run python -m compileall app main.py
  • Contributions welcome; include screenshots for UI tweaks.