Partial color processing for visual-novel style artwork.
patcolour keeps selected regions in color while the rest becomes monochrome. It is meant
to sit between raw photo editing and the larger skirts-colour production pipeline, and to
be callable from other tools that need stable image-processing behavior.
The target use case is not generic "selective color" photography. The real goal is more specific: keep emotionally important parts in color while the rest falls back to memory-like grayscale. That makes mask quality, edge softness, and region selection workflow more important than a huge option surface.
Just as importantly, this tool is expected to become reusable infrastructure for other repos,
including name-name-based skirts-colour workflows and future image-processing utilities.
uv tool install patcolourOr from source:
git clone https://github.com/kako-jun/patcolour.git
cd patcolour
uv sync --group dev
uv run patcolour --helppatcolour photo.jpg --mask mask.png -o output.pngWhite areas in the mask stay in color. Black areas become monochrome.
patcolour photo.jpg \
--rect 120,40,220,180 \
--ellipse 540,260,110,80 \
--feather 12 \
-o output.pngpatcolour photo.jpg --auto-detect -o output.pngpatcolour photo.jpg --sample 420,180 --lab-radius 16 -o output.pngThis mode samples one pixel from the input and keeps nearby colors using Lab chroma distance, which is a better fit than raw RGB distance for "keep this hue family" workflows.
patcolour photo.jpg \
--sample 420,180 \
--lab-radius 16 \
--ellipse 420,180,90,120 \
--feather 10 \
-o output.pngColor alone is not enough for many scenes. In practice, the user often needs to combine a color sample with a spatial guide.
patcolour ./photos/ --mask-dir ./masks/ -o ./output/--maskuses an external grayscale mask--rectand--ellipsedefine keep-color regions--auto-detectkeeps broad HSV-detected colorful areas--samplekeeps colors near a sampled reference point in Lab chroma space--feathersoftens coordinate-based region edges
The CLI is the first interface, but not the only intended interface. The filter logic should stay predictable enough to be reused from other tools.
Just as importantly, this is a human-guided tool. If the scene contains several similar purples, reds, or greens with different semantic roles, the user must be able to tell the tool which region is the intended subject.
If --auto-detect is combined with coordinate regions, the result is their intersection.
- Auto-detection is currently tuned for broad colorful regions and is easy to over-select
- There is no semantic selection yet such as "left flower only" or "girl's ribbon only"
- Batch mode currently assumes one mask per file and does not validate coverage quality
docs/overview.md— positioning, goals, non-goalsdocs/spec.md— CLI and processing behaviordocs/roadmap.md— internal roadmap and quality targetsCLAUDE.md— AI-facing internal guide
uv sync --group dev
uv run ruff check .
uv run pytest