morphology-toolkit

morphology-toolkit is a skill for Claude Code, Codex from aeren23/image-processing-skills. It costs 30 tokens per session (1,223 once invoked), scanned A, original, MIT.

A guide to grayscale image morphology, a method that changes shapes in images using a chosen small pattern. It explains opening, closing, erosion, dilation, and contrast filters.

In plain words
What is it for?
Use it on thresholded images, fingerprints, cell images, document scans, and similar inputs to clean images, separate objects, find boundaries, or create skeletons.
Why use it?
It helps choose the right operation for removing specks, filling holes, separating touching objects, connecting broken lines, or highlighting features.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it on thresholded images, fingerprints, cell images, document scans, and similar inputs to clean images, separate objects, find boundaries, or create skeletons.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/aeren23/image-processing-skills/04-morphology-toolkit
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add aeren23/image-processing-skills --skill 04-morphology-toolkit
Clone the repo
git clone --depth 1 https://github.com/aeren23/image-processing-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for morphology-toolkit

README.md
[![agentmods](https://agentmods.dev/badge/skills/aeren23/image-processing-skills/04-morphology-toolkit/github.svg)](https://agentmods.dev/skills/aeren23/image-processing-skills/04-morphology-toolkit)
Your own site
<a href="https://agentmods.dev/skills/aeren23/image-processing-skills/04-morphology-toolkit"><img src="https://agentmods.dev/badge/skills/aeren23/image-processing-skills/04-morphology-toolkit/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for morphology-toolkit

Your own site · 80×15
<a href="https://agentmods.dev/skills/aeren23/image-processing-skills/04-morphology-toolkit"><img src="https://agentmods.dev/badge/skills/aeren23/image-processing-skills/04-morphology-toolkit.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,223 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00030 $0.01223
Opus 5 $0.00015 $0.00611
Sonnet 5 $0.00006 $0.00245
Haiku 4.5 $0.00003 $0.00122

Measured 10d ago against content hash eb51dbb81b9d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

morphology-toolkit scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/04-morphology-toolkit/SKILL.md · 141 lines

How it starts

The opening of the file, as written. The whole thing — 141 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Morphology Toolkit

When to Use This Skill

  • Cleaning binary images after thresholding (removing noise, filling holes)
  • Separating touching objects in segmentation results
  • Extracting object boundaries or skeletons
  • Enhancing contrast for specific features (Top-Hat/Bottom-Hat)
  • Processing fingerprints, cell images, document scans

Decision Framework

The Core Four Operations

What do you need to clean up?
├── Small white noise specks on black background (external noise)
│   └── ✅ Opening (Erosion → Dilation)
│
├── Small black holes inside white objects (internal gaps)
│   └── ✅ Closing (Dilation → Erosion)
│
├── Objects touching each other (need separation)
│   └── ✅ Erosion (shrinks objects apart)
│
└── Broken lines or gaps in object boundaries
    └── ✅ Dilation (expands and connects)

Opening vs Closing — The Memory Trick

Operation Formula Removes Keeps Memory Aid
Opening Erode → Dilate External noise Object integrity "Opens" gaps between noise and object
Closing Dilate → Erode Internal holes Object shape "Closes" holes inside object

Golden rule: Opening cleans the outside, Closing fills the inside.

Real-world example — Fingerprint processing:

  1. Opening removes background dirt/smudges
  2. Closing reconnects broken ridge lines

Structuring Element Selection

Shape OpenCV Constant Best For
Rectangle/Square cv2.MORPH_RECT Angular objects, text characters
Ellipse/Disk cv2.MORPH_ELLIPSE Round objects, cells, coins
Cross (+) cv2.MORPH_CROSS Thin lines, intersections

Size selection rule: The structuring element must be:

  • Larger than the noise you want to remove
  • Smaller than the objects you want to keep
kernel = cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (5, 5))

Contrast Enhancement Morphology

Filter Formula Reveals Use Case
Top-Hat Original - Opening Bright details on dark background Bright spots, text on dark surface
Bottom-Hat Closing - Original Dark details on bright background Dark spots, stains on light surface

Read the full file on GitHub · 141 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 141 lines · 30 tokens per session scan A eb51dbb81b9d

Subscribe to this mod's changes

morphology-toolkit is a skill published in the GitHub repository aeren23/image-processing-skills (5 stars, last pushed 3mo ago), licensed MIT. It adds 30 tokens to every session and 1,223 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

landlab

Landscape evolution and surface process modelling in Python. Build 2D numerical models for erosion, hydrology, soil transport, and geomorphology. Use when Claude needs to: (1) Model landscape evolution over time, (2) Simulate river/stream erosion, (3) Route water flow across terrain, (4) Model hillslope diffusion…

SteadfastAsArt/geoscience-skills · 114 tokens

spatial-modality-integrate

Identify spatial domains with DeepST or PearlST. This skill is directory-only: use --input /path/to/sample for single-sample runs; use --mode integration --input-list samples.txt only with DeepST.

ShangBioLab/SpatialClaw · 54 tokens

spatial-morphology

Python API skill for morphology feature extraction and image-expression feature fusion in spatial analysis workflows.

ShangBioLab/SpatialClaw · 23 tokens

instrument-data-to-allotrope

Convert laboratory instrument output files (PDF, CSV, Excel, TXT) to Allotrope Simple Model (ASM) JSON format or flattened 2D CSV. Use this skill when scientists need to standardize instrument data for LIMS systems, data lakes, or downstream analysis. Supports auto-detection of instrument types. Outputs include full…

anthropics/knowledge-work-plugins · 123 tokens

matlab

Build, review, migrate, and safely plan MATLAB or GNU Octave numerical workflows, including arrays, tabular/time data, tests, projects, graphics, MAT files, and explicit Python interoperability.

K-Dense-AI/scientific-agent-skills · 42 tokens

exploratory-data-analysis

Perform bounded, local exploratory analysis of explicitly supported scientific files. Use for redacted CSV/TSV/JSON profiles; optional NumPy, HDF5, FASTA/FASTQ, and basic image metadata inspection; missingness/leakage audits; outlier and transformation sensitivity; and rigorous EDA report scaffolds. Other domain…

K-Dense-AI/scientific-agent-skills · 83 tokens