Edit images with precision — crop, resize, mirror, rotate, trim, and reframe.

MITAuto-check passedMedia & Creative

Install Image Edit

skills CLI
$ npx skills add peterkrueck/Claude-Code-Development-Kit --skill image-edit -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install peterkrueck/Claude-Code-Development-Kit image-edit --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/peterkrueck/Claude-Code-Development-Kit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/image-edit .claude/skills/image-edit && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
image-edit
GitHub stars
1.4k
Token cost
~1.2k tokens
SKILL.md length
503 words
Files
3 (incl. scripts)
Skills in repo
9
Repo updated
First seen
Licence
MIT

At a glance

Edit images with precision — crop, resize, mirror, rotate, trim, and reframe.

  • Works in 5 steps: Visual inspection → Analyze content bounds → Calculate crop coordinates → …
  • The user asks to crop
  • SKILL.md covers Setup, The Golden Rule: Measure…, Workflow and Common Tasks, plus 1 more section
  • Runs Python scripts from its folder; calls python3 and pip

What it does

Image Edit is an agent skill from peterkrueck/Claude-Code-Development-Kit. Edit images with precision — crop, resize, mirror, rotate, trim, and reframe. Use this skill whenever the user asks to crop, resize, trim, mirror, flip, rotate, reframe, or otherwise manipulate an image. Also use for creating square crops, portraits/headshots from full-body images, icon sizes, or any image transformation. Even if the request sounds simple, this skill prevents common pitfalls and ensures correct results on the first try.

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including scripts (for example `scripts/analyze_bounds.py` and `scripts/crop_image.py`).

It sits in Media & Creative, covering Image editing. The repository describes itself as: Claude Code Workflow for beginners & intermediate users. Tutorial and Installer included. The licence is MIT.

When your agent uses it

  • The user asks to crop
  • Otherwise manipulate an image
  • Creating square crops
  • Portraits/headshots from full-body images

Example prompts

  • “/image-edit”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Visual inspection
  2. Analyze content bounds
  3. Calculate crop coordinates
  4. Apply operations
  5. Verify

What it can do on your machine

Read from SKILL.md and the folder at commit ba85375. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 2 files in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python3
    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use pip, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Image Edit loads about 1.2k tokens when it runs. Until then it costs about 113 tokens; SKILL.md has 503 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~113
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from peterkrueck/Claude-Code-Development-Kit at commit ba85375, republished under its MIT licence (© peterkrueck). 503 words, ~1,181 tokens.

Download SKILL.mdSave it as .claude/skills/image-edit/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
image-edit
description
Edit images with precision — crop, resize, mirror, rotate, trim, and reframe. Use this skill whenever the user asks to crop, resize, trim, mirror, flip, rotate, reframe, or otherwise manipulate an image. Also use for creating square crops, portraits/headshots from full-body images, icon sizes, or any image transformation. Even if the request sounds simple, this skill prevents common pitfalls and ensures correct results on the first try.
user_invocable
true

Image Edit — Crop, Resize & Transform

Precision image manipulation using Python/Pillow. This skill exists because macOS sips has unreliable crop offset behavior and visual inspection alone leads to bad coordinates — images often have hundreds of pixels of invisible padding that throws off naive crops.

Setup

The scripts need Pillow and numpy. Create a temp venv on first use:

bash
python3 -m venv /tmp/imgcrop && /tmp/imgcrop/bin/pip install Pillow numpy -q

This only needs to happen once per session. The venv at /tmp/imgcrop persists until reboot.

The Golden Rule: Measure Before You Cut

Never guess crop coordinates from visual inspection. Images routinely have large invisible regions — transparent padding, solid-color borders, or dead space — that make visual estimates wildly wrong.

Always run the analysis script first to get exact pixel coordinates of where the actual content lives.

Workflow

Step 1 — Visual inspection

Use the Read tool to look at the image. Understand what's in it and what the user wants to focus on.

Step 2 — Analyze content bounds

Run the bundled analysis script to find where content actually lives:

bash
/tmp/imgcrop/bin/python3 .claude/skills/image-edit/scripts/analyze_bounds.py <image_path>

This outputs JSON with:

  • content_bounds — exact pixel coordinates of non-background content
  • padding — how much dead space exists on each side
  • suggested_square_crops — pre-calculated crop regions at different zoom levels:
    • tight_head (35%) — face/head closeup
    • upper_body (55%) — head through chest/arms
    • three_quarter (75%) — head through waist
    • full (100%) — entire subject

Use --threshold to adjust sensitivity (default 30).

Step 3 — Calculate crop coordinates

Use the analysis output to compute exact crop coordinates:

  • Headroom: Add 40-70px above the content top
  • Centering: Center horizontally on the content's center-x, not the image's center
  • Aspect ratio: For square crops, use max(width, height) as the side length
  • Clamping: Ensure the crop region doesn't extend beyond image dimensions
Show full SKILL.md (232 more words)Show less
Step 4 — Apply operations

Use the bundled script. All operations are optional and composable — applied in order: crop -> mirror -> rotate -> resize.

bash
/tmp/imgcrop/bin/python3 .claude/skills/image-edit/scripts/crop_image.py \
  <input_path> <output_path> \
  [--left L --top T --right R --bottom B] \
  [--mirror horizontal|vertical] \
  [--rotate DEGREES] \
  [--resize WxH]

Flags:

FlagRequiredDescription
--left/--top/--right/--bottomNo (but all four if any)Crop region in pixels. (0,0) is top-left.
--mirrorNohorizontal (or h) flips left-right. vertical (or v) flips top-bottom.
--rotateNoCounter-clockwise degrees. 90/180/270 are pixel-perfect; other angles expand the canvas.
--resizeNoFinal dimensions, e.g. 512x512. Applied after all other operations. Uses LANCZOS resampling.

Important: Always save to a NEW file. Never overwrite the original.

Step 5 — Verify

Read the output image with the Read tool to visually confirm the result. If it doesn't look right, adjust and re-run — the original is untouched.

Common Tasks

Square crop of a subject
  1. Analyze bounds to find content region
  2. Use the appropriate suggested crop (upper_body, three_quarter, etc.)
  3. Adjust for headroom and centering
Mirror an image
bash
/tmp/imgcrop/bin/python3 .claude/skills/image-edit/scripts/crop_image.py \
  input.png output-mirrored.png --mirror horizontal
Resize to specific dimensions
  1. Crop first if needed (to set the right aspect ratio)
  2. Use --resize WxH to scale
Trim transparent/white padding
  1. Analyze bounds — the padding field tells you how much dead space exists
  2. Crop to content_bounds plus a small margin (10-20px)
Generate multiple sizes (e.g., app icons)
  1. Start with the highest-resolution crop
  2. Run multiple commands with different --resize values

Do NOT use macOS sips

The sips command-line tool has unreliable --cropOffset behavior. Use the Python scripts instead.

© peterkrueck, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (scripts) in skills/image-edit of peterkrueck/Claude-Code-Development-Kit.

  • SKILL.md
  • scripts/analyze_bounds.py
  • scripts/crop_image.py

Open the folder on GitHubat commit ba85375

Compare with similar skills

Image Edit next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Image Edit compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Image Edit this skillpeterkrueck/Claude-Code-Development-Kit1.4k—~1.2kAutomated safety check: PassMIT
AI Image Generation and Editingzhayujie/CowAgent47k—~1.3kAutomated safety check: PassMIT
Media Useedenfunf/reelmimic1.7k2 repos~2kAutomated safety check: PassMIT
Generate Imageynulihao/AgentSkillOS61710 repos~1.7kAutomated safety check: NotesNone
GPT Image Generation CLIwuyoscar/GPT-Image2-Skill5.7k—~2.5kAutomated safety check: NotesMIT
HyperFrames Media Useheygen-com/hyperframes59k—~2.4kAutomated safety check: PassApache-2.0

Similar skills

  • Generates or edits images from text prompts through a Python script that picks an image backend based on which API keys are configured.

    47k GitHub stars~1.3k tokensUpdated today
    Media & CreativeAuto-check passed
  • Media Use

    edenfunf/reelmimic

    Agent Media OS, the single skill for every media need in a HyperFrames project.

    1.7k GitHub starsUsed in 2 repos~2k tokens
    Media & CreativeAuto-check passed
  • Generate Image

    ynulihao/AgentSkillOS

    Generate or edit images using AI models (FLUX, Gemini). An agent skill from ynulihao/AgentSkillOS.

    617 GitHub starsUsed in 10 repos~1.7k tokens
    Media & CreativeAuto-check: notes
  • GPT Image Generation CLI

    wuyoscar/GPT-Image2-Skill

    Generates and edits images with GPT Image 2 or 2.5 through a packaged CLI and a prompt gallery, after settling which model fits the request.

    5.7k GitHub stars~2.5k tokensUpdated 8 days ago
    Media & CreativeAuto-check: notes
  • HyperFrames Media Use

    heygen-com/hyperframes

    Finds, generates and edits media for HyperFrames video projects: music, sound effects, images, icons, logos, voiceovers, captions and color grades.

    59k GitHub stars~2.4k tokensUpdated today
    Media & CreativeAuto-check passed
  • Nanobanana

    ReScienceLab/opc-skills

    Generate and edit images using Google Gemini 3 Pro Image (Nano Banana Pro).

    1.8k GitHub starsUsed in 1 repo~1.3k tokens
    Media & CreativeAuto-check passed

More from peterkrueck/Claude-Code-Development-Kit

All 9 skills in this repo
  • Image Gen

    peterkrueck/Claude-Code-Development-Kit

    Generate character art and image variations using AI image generation (Google Gemini) with reference images for style and character consistency.

    1.4k GitHub stars~1.4k tokensUpdated 2 mo ago
    Auto-check passed
  • Bg Remove

    peterkrueck/Claude-Code-Development-Kit

    Remove backgrounds from images using local AI (rembg). An agent skill from peterkrueck/Claude-Code-Development-Kit.

    1.4k GitHub stars~1.3k tokensUpdated 2 mo ago
    Auto-check passed
  • Context7 Guidance

    peterkrueck/Claude-Code-Development-Kit

    Fetch CURRENT library/framework/API/CLI documentation via Context7 instead of relying on training data.

    1.4k GitHub stars~671 tokensUpdated 2 mo ago
    Auto-check passed
  • Second Opinion

    peterkrueck/Claude-Code-Development-Kit

    Get a second opinion from OpenAI's Codex CLI running locally.

    1.4k GitHub stars~2.4k tokensUpdated 2 mo ago
    Auto-check: warnings
  • Deploy

    peterkrueck/Claude-Code-Development-Kit

    Test and deploy changes safely. An agent skill from peterkrueck/Claude-Code-Development-Kit.

    1.4k GitHub stars~3.3k tokensUpdated 2 mo ago
    Auto-check passed
  • Second Opinion Gemini

    peterkrueck/Claude-Code-Development-Kit

    Get a second opinion from Google's Gemini Pro via the locally installed Gemini CLI (defaults to gemini-3.1-pro-preview; override with the CLAUDESECONDOPINIONMODEL env var).

    1.4k GitHub stars~2.3k tokensUpdated 2 mo ago
    Auto-check: warnings

Questions about Image Edit

What does Image Edit do?

Edit images with precision — crop, resize, mirror, rotate, trim, and reframe. Image Edit is an agent skill from peterkrueck/Claude-Code-Development-Kit. Edit images with precision — crop, resize, mirror, rotate, trim, and reframe.

When should I use Image Edit?

Image Edit fits situations like: the user asks to crop; otherwise manipulate an image; creating square crops; portraits/headshots from full-body images.

How do I install Image Edit in Claude Code?

Run `npx skills add peterkrueck/Claude-Code-Development-Kit --skill image-edit -a claude-code`. Or copy the skill folder (skills/image-edit in peterkrueck/Claude-Code-Development-Kit) into .claude/skills/image-edit in your project. Claude Code loads it when a task matches its description.

How do I install Image Edit in Codex?

Run `npx skills add peterkrueck/Claude-Code-Development-Kit --skill image-edit -a codex`. Or copy the skill folder (skills/image-edit in peterkrueck/Claude-Code-Development-Kit) into .agents/skills/image-edit in your project. Codex loads it when a task matches its description.

Can I use Image Edit in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add peterkrueck/Claude-Code-Development-Kit --skill image-edit -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/image-edit, .gemini/skills/image-edit, .github/skills/image-edit and .opencode/skills/image-edit in your project.

What does Image Edit need to run?

Going by SKILL.md and its folder, Image Edit needs Python for the scripts in its folder and the command-line tools its instructions call (python3 and pip). Our summary lists: Python 3.

Does Image Edit access the network?

SKILL.md contains no URLs. Its commands use pip, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Image Edit safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Image Edit use?

Image Edit is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Image Edit use?

About 1.2k tokens (SKILL.md is roughly 4.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Image Edit?

Skills that share tags, products or a category with Image Edit: AI Image Generation and Editing (zhayujie/CowAgent, 47k stars), Media Use (edenfunf/reelmimic, 1.7k stars), Generate Image (ynulihao/AgentSkillOS, 617 stars) and GPT Image Generation CLI (wuyoscar/GPT-Image2-Skill, 5.7k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Image Edit?

peterkrueck (a GitHub user) maintains it in peterkrueck/Claude-Code-Development-Kit, which has 1,385 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on July 22, 2026.

Source: peterkrueck/Claude-Code-Development-Kit on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.