xxg-portrait-rebuild-light

by moskooVerified

`xxg-portrait-rebuild-light` is an image-edit skill for existing portrait photos. It reconstructs the key light, fill, shadows, and background atmosphere with a director-led lighting workflow while restoring clean, healthy, low-contrast photographic skin microtexture.

73
Stars
13
Forks
Python
Language
8/24/2026
Added
View on GitHubDownload ZIP

⚠️ Third-Party Software Notice

This skill is third-party open-source software developed and hosted independently on GitHub. SkillTip is an informational directory and does not control or maintain the underlying repository. Any security checks displayed are automated and limited in scope. Review the source code before installing.

Read the Terms of Service

Installation

Add to your Claude Code skills directory:

# Add to your Claude Code skills
git clone https://github.com/moskoo/xxg-portrait-rebuild-light

Getting Started

Guides for using skills like xxg-portrait-rebuild-light.

Security Report

Verified

Last scanned: —

{
  "status": "PASSED",
  "issues": []
}

README.md

xxg-portrait-rebuild-light skill-logo

XXG Portrait Rebuild Light

MIT License Python codex Claude OpenClaw

English | 简体中文 | 日本語 | 한국어

xxg-portrait-rebuild-light is an image-edit skill for existing portrait photos. It reconstructs the key light, fill, shadows, and background atmosphere with a director-led lighting workflow while restoring clean, healthy, low-contrast photographic skin microtexture.

The skill changes the lighting without redrawing the person. It preserves identity, facial structure and proportions, natural slight asymmetry, expression, pose, camera view, and composition. It avoids plastic skin, grainy skin, dirty color variation, and fake depth made by exaggerating wrinkles.

Key features

  • Repairs plastic smoothness, excessive skin smoothing, and wax-like rendering.
  • Preserves original lip lines, eye-area detail, restrained sebum highlights, and scale-appropriate microtexture.
  • Repairs weak backlighting, disconnected indoor window light, flat lighting, unintended crushed shadows, and highlights with no physical source.
  • Supports soft window light, commercial soft light, Rembrandt lighting, cinematic low-key lighting, golden hour, dual-color neon, and diagonal hard light.
  • Adds at most one physically coherent atmosphere effect: window shadow, tree shadow, background bokeh, sunset flare, subtle volumetric light, or a full-black backlit subject silhouette.
  • Controls subject and background in layers: key light and exposure intent first, then fill, shadows, ambient light, and color temperature.
  • Preserves identity, facial feature size and position, expression, pose, wardrobe, background structure, and source framing.
  • Reduces the skin-detail target automatically when the face is small, without canceling the requested lighting change.
  • Uses the current agent's own image-generation or image-editing capability by default; no separate API is required.
  • If the current agent has no image-edit capability, or the edit misses the target, returns one complete compact image-edit prompt.
  • Never uses Pillow, NumPy, OpenCV, ImageMagick, or temporary filter scripts to produce the delivered image.

演示图片 演示图片 演示图片 演示图片

Core method

The skill first makes a director-style lighting decision internally:

Key light → Exposure intent → Fill → Shadow → Subject → Background → Atmosphere

The prompt sent to the image model is compressed into four lines, usually 40–90 English words:

Edit: relight; keep the same person, structure, expression, pose, camera, and composition.
Lighting: one key + exposure/shadow strategy + background response + optional atmosphere.
Skin: clean low-contrast microtexture matched to visible face scale.
Constraints: no identity change, smoothing, dirty texture, or background redraw.

The skill does not pile identity audits, object inventories, repeated negatives, and several photographic styles into one prompt. That often causes constraints to cancel each other or produces an unchanged copy.

Physical lighting takes priority over keeping every detail visible. The skill selects an exposure intent from source-matched, balanced, highlight-priority, shadow-priority, low-key, silhouette, and high-key. Sunset backlight may naturally darken the unlit side of the face or create a partial silhouette. Low-key and hard lighting may contain near-black shadows. Fill is used only when information that should remain readable is lost without a plausible cause.

A6 is a forced override: whenever selected, it switches to silhouette exposure, moves the effective light behind the person, removes all fill and catchlights, and renders the entire subject interior black. The selected L and T recipes control only the backlight and background response; the S recipe is not rendered visibly.

Recipes

Choose only:

one L lighting recipe + one S skin recipe + one T color-temperature recipe + zero or one A atmosphere recipe

Lighting L

CodePurpose
L0Match the source; repair only flat light, unexplained crushed shadows, abnormal highlights, and harsh transitions
L1Natural backlight, highlight-priority by default; add fill only when explicitly requested
L2Soft natural window light
L3Large commercial soft light
L4Outdoor skylight
L5Indoor practical and mixed lighting
L6Hard single-point light or direct sunlight
L7Low-key diagonal narrow light beam
L8Classic editorial Rembrandt lighting
L9Cinematic low-key warm key / cool ambient light
L10Golden-hour sunset side backlight
L11Cyberpunk cyan/magenta dual-tone neon
L12Clean, even commercial soft light

Skin S

CodePurpose
S0Small face or wide shot; restore only clean skin tone and natural reflection
S1Default for medium shots; low-contrast microtexture with original lip and eye-area detail
S2High-resolution close-up; region-aware pores, fine vellus hair, and existing details

Color temperature T

CodePurpose
T0Preserve the source white balance
T1Neutral natural daylight
T2Golden warm light with healthy neutral zones retained in the skin
T3Warm key light with cool background ambience
T4Cyan/magenta neon relationship

Atmosphere A

CodePurpose
A0Add no atmosphere effect
A1Soft window shadow
A2Sparse natural tree shadow
A3Soft bokeh restricted to the defocused background
A4Gentle lens flare aligned with the sunset direction
A5Very subtle volumetric light with sparse dust motes
A6Force the entire backlit subject to a clean black silhouette; no face, skin, hair, or clothing detail remains visible inside

See Lighting, skin, color-temperature, and atmosphere recipes for detailed prompt clauses.

Image capabilities by agent

AgentDefault route
CodexRead the $imagegen rules, discover the actual tool in ALL_TOOLS, prefer tools.image_gen__imagegen, and pass source images through referenced_image_paths
Claude CodeUse the image-generation or image-editing capability installed or built into the current environment
OpenClawUse the imagegen skill or native image action enabled for the current agent
Other agentsUse an equivalent image-edit capability explicitly exposed by the tool registry

In Codex, the skill never guesses tools.image_gen or input_image. It returns a prompt handoff only after tool discovery confirms that no compatible image capability exists. If the real image tool fails, produces an almost unchanged image, changes identity, or dirties the skin, the skill also returns a short copy-ready prompt.

Requirements

  • An agent that supports directory-based SKILL.md skills.
  • An image-generation or image-editing capability in the current agent.
  • Python 3.9 or newer, used only for read-only aspect-ratio, mask, and region checks.
  • Pillow 9.1 or newer, used only for read-only analysis and never to create the final image.

Install the read-only script dependencies:

python3 -m pip install -r ./xxg-portrait-rebuild-light/requirements.txt

Install in Codex

Personal skill:

mkdir -p ~/.codex/skills
cp -R ./xxg-portrait-rebuild-light ~/.codex/skills/

Shared Agent Skills directory:

mkdir -p ~/.agents/skills
cp -R ./xxg-portrait-rebuild-light ~/.agents/skills/

For a project-level install, place it in .agents/skills/ at the project root. Invoke it explicitly with $xxg-portrait-rebuild-light.

Install in Claude Code

Personal install:

mkdir -p ~/.claude/skills
cp -R ./xxg-portrait-rebuild-light ~/.claude/skills/

Project install:

mkdir -p .claude/skills
cp -R ./xxg-portrait-rebuild-light .claude/skills/

Invoke it with /xxg-portrait-rebuild-light.

Install in OpenClaw

Local install:

openclaw skills install ./xxg-portrait-rebuild-light \
  --as xxg-portrait-rebuild-light

Shared install:

openclaw skills install ./xxg-portrait-rebuild-light \
  --as xxg-portrait-rebuild-light \
  --global

You can also copy the complete directory into the current agent workspace's skills/ directory or the shared ~/.openclaw/skills/ directory.

Install in other agents

Copy the complete xxg-portrait-rebuild-light/ directory into the agent's personal or project skill root. Preserve the relative structure of SKILL.md, requirements.txt, references/, scripts/, and agents/, then reload the skill list.

Usage examples

Classic fashion editorial

Use $xxg-portrait-rebuild-light to edit this portrait with L8 + S2 + T1 + A0.
A large soft key from the upper front-side creates restrained Rembrandt lighting; subtle fill preserves the eye socket, one cheek falls into a deep soft shadow, and the eyes receive one source-consistent catchlight. Keep the skin clean and healthy with low-contrast photographic microtexture.

Cinematic low-key warm/cool

Use $xxg-portrait-rebuild-light to edit this portrait with L9 + S1 + T3 + A5.
A warm side key shapes the lit and shadow sides. Use low-key exposure with no frontal fill, allowing the unlit side to approach black. Keep cool color only in the background and rim, with extremely subtle volumetric dust; no dirty gray skin or exaggerated wrinkles.

Golden-hour backlight

Use $xxg-portrait-rebuild-light to edit this portrait with L10 + S1 + T2 + A4.
Warm sunset light from the side-rear outlines the hair and shoulders. Expose for the sunset highlights with no frontal fill; let the unlit side of the face fall naturally into a partial silhouette, allow slight bloom on lit edges, and give the background matching oblique warm light and long shadows.

Cyberpunk neon

Use $xxg-portrait-rebuild-light to edit this night portrait with L11 + S1 + T4 + A3.
Separate the cyan rim light clearly from the magenta key while preserving a natural skin-tone zone in the center of the face. Keep bokeh only in the defocused background, never over the eyes or skin.

Full-black backlit silhouette

Use $xxg-portrait-rebuild-light to edit this portrait with L10 + S1 + T2 + A6.
Place the effective light behind the person and expose for the bright background. Remove all frontal and side fill, catchlights, and internal subject illumination. Render the face, skin, hair, clothing, and body as one clean continuous black silhouette while preserving the original outer contour, proportions, pose, camera view, and composition.

Soft window light with window shadow

Use $xxg-portrait-rebuild-light to edit this indoor portrait with L2 + S1 + T1 + A1.
Soft window light from the upper-left front creates a broad, gradual left-to-right falloff; faint room fill preserves the shadow side. One low-contrast window shadow continues across the person and adjacent wall and must not look pasted on.

Portrait with tree shadows

Use $xxg-portrait-rebuild-light to edit this outdoor portrait with L4 + S1 + T1 + A2.
Broad skylight illuminates the person. Sparse tree shadows break softly across facial and clothing curvature, may cross parts of the eyes and cheeks where physically plausible, and continue into the background in the same direction. Keep shadows clean and free of unexplained dirty patches.

Output standard

  • The target key light, light-to-shadow relationship, or atmosphere effect is immediately visible at normal viewing size.
  • The subject remains the same person; facial features are neither beautified nor made artificially symmetrical.
  • Subject, clothing, and background obey the same light sources.
  • Shadow depth, highlight roll-off, and silhouette strength follow the selected exposure intent instead of flattening the scene to keep everything visible.
  • Skin remains fair, healthy, clean, and continuous, with low-contrast photographic microtexture that is never rough or blotchy.
  • Grain, chromatic noise, dirty gray shadows, local oversharpening, and exaggerated wrinkles are not used to imitate realism.
  • Window shadows, tree shadows, bokeh, sunset flare, and light beams have a plausible source and landing area.
  • With A6, the complete subject interior is clean black with no facial, skin, hair, clothing, or catchlight detail; identity continuity is judged from the preserved outer contour, proportions, pose, and framing.
  • Preserve composition, orientation, aspect ratio, and the subject's share of the frame. Proportional downscaling to an image model's maximum resolution is allowed; exact source pixel dimensions are not required.

Related files

License

Licensed under the MIT License.

Frequently Asked Questions

What is xxg-portrait-rebuild-light?

xxg-portrait-rebuild-light is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by moskoo. `xxg-portrait-rebuild-light` is an image-edit skill for existing portrait photos. It reconstructs the key light, fill, shadows, and background atmosphere with a director-led lighting workflow while restoring clean, healthy, low-contrast photographic skin microtexture. It has 73 GitHub stars.

Is xxg-portrait-rebuild-light safe to use?

Yes. xxg-portrait-rebuild-light passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install xxg-portrait-rebuild-light?

Clone the repository with "git clone https://github.com/moskoo/xxg-portrait-rebuild-light" and add it to your Claude Code skills directory (see the Installation section above). xxg-portrait-rebuild-light ships a SKILL.md manifest, so compatible agents can discover and load it automatically.

What programming language is xxg-portrait-rebuild-light written in?

xxg-portrait-rebuild-light is primarily written in Python. It is open-source under moskoo on GitHub, so you can review or fork the full source.

Are there alternatives to xxg-portrait-rebuild-light?

Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh xxg-portrait-rebuild-light against similar tools.

Comments (0)

No comments yet. Be the first to share your thoughts!

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI Agentsai-agentsanthropicclaude-code
View details
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI Agentsai-agentsbrainstorming
View details

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI Agentsai-agentsanthropicclaude-code
View details

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI Agentsclaude-codeai-tools
View details

claude-code

by anthropics

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

120,03119,897Shell
AI Agents
View details

Developers Also Liked

Based on votes and bookmarks from developers who liked this skill

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI Agentsai-agentsanthropicclaude-code
View details
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI Agentsai-agentsbrainstorming
View details

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP Serversapisai-tools
View details

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI Agentsai-agentsanthropicclaude-code
View details

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI Agentsclaude-codeai-tools
View details