Edit an existing JPG, JPEG, PNG, or WebP portrait to rebuild physically coherent light, exposure, color, capture style, and clean optical skin realism without changing the person. Use for plastic-skin or AI-look removal, tone or white-balance correction, camera/film/device emulation, backlight, prism refraction, blind shadows, candlelight, neon, golden-hour or rim light, rain-wet low key, studio light, or full-black silhouettes.
Permissions
Files
Edit an existing JPG, JPEG, PNG, or WebP portrait to rebuild physically coherent light, exposure, color, capture style, and clean optical skin realism without changing the person. Use for plastic-skin or AI-look removal, tone or white-balance correction, camera/film/device emulation, backlight, prism refraction, blind shadows, candlelight, neon, golden-hour or rim light, rain-wet low key, studio light, or full-black silhouettes.
Version history
Treat the input as the same photograph, never as a reference for a replacement portrait. Improve illumination, exposure, color rendering, capture character, and skin response while retaining identity, facial geometry and natural asymmetry, expression, pose, camera view, framing, and subject scale. Preserve source optics unless the user explicitly requests an optical restyle.
Build realism from three separable signals:
Do not manufacture realism with dirt, darkness, coarse pores, uniform grain, random color patches, or exaggerated facial lines. The result must first read as a clean photograph at normal size.
texture-only: when the user asks only to remove plastic/AI skin or recover detail, force L0 + E0 + T0 + G0 + D0 + A0. Preserve the source lighting, highlight placement, exposure, white balance, focal plane, depth of field, and background.tone-and-exposure: when the user asks for brightness, highlight/shadow recovery, white balance, palette, or grading without new lighting, preserve the source light direction and edit only E/T/G.relight-and-skin: when the user requests a lighting change or selects L/T/A, authorize the requested light response while preserving source focal plane and depth of field unless explicitly changed.capture-style: when the user requests a camera, film, phone, CCD, or era look, edit G/D and only the exposure behavior logically required by that capture; preserve viewpoint, crop, focal plane, and depth of field.optical-restyle: only when the user explicitly requests a different focal-length perspective, camera angle, aperture behavior, or depth of field. State that axis once and permit only the minimum framing/background reconstruction it requires.Never let texture repair become relighting, tone correction become a new light source, or device emulation become a new pose/viewpoint.
ALL_TOOLS and prefer the exact discovered name image_gen__imagegen.const result = await tools.image_gen__imagegen({
referenced_image_paths: ["/absolute/path/source.png"],
prompt: "compact four-line English image-edit prompt"
});
generatedImage(result);
Never guess tools.image_gen or input_image. Correct wrong members, arguments, or TypeError from the registered signature and retry. In Claude, OpenClaw, or another host, use the equivalent native image-edit action explicitly exposed by that host.
| Observed state | Required action |
|---|---|
| Compatible image tool discovered | Invoke it. A small face, dense text, complex props, or edge contact lowers detail ambition but never blocks generation. |
| Correct image tool returns a real error | Report the actual error, enter prompt-only, and return a complete compact prompt. |
| Discovery completes with no compatible callable | Enter invocation-handoff and return a complete compact prompt. |
| Result is nearly unchanged, changes identity, creates artificial skin, or misses the light | State that the result did not achieve the requested improvement, enter prompt-handoff, and recompile from the source. |
Reading a skill, inspecting an image, creating a task, or announcing generation is not an image-tool invocation.
Do not use Pillow, NumPy, OpenCV, ImageMagick, FFmpeg, sips, or custom raster scripts to relight, grade, retouch, sharpen, add texture, resize, crop, extend, composite, repair, or produce the delivered image. Use them only for read-only aspect-ratio, mask, and result audits. See requirements.txt.
Read the V2.2 prompt compiler, the lighting and skin recipes, and the tone/exposure/style/device recipes. Decide internally as:
Scope → Key L → Exposure E → Fill/Shadow → Skin scale S → Skin finish P → Light color T → Look G → Capture D → Background/Atmosphere A
Select exactly:
one L + one E + one S + one P + one T + one G + one D + zero or one A
Use one key-light system. Atmosphere and skin reflections must inherit its direction, size, falloff, and color. E controls exposure, G controls palette/curve, and D controls capture response; none may invent another light. A6 is the sole override: force E6 silhouette exposure, remove all subject fill/catchlights/internal illumination, use L/T only for the rear source and background, and suppress S/P.
Send four core lines, adding RENDER only for a requested grade or device response:
EDIT: scope, identity/structure lock, and source-optics lock.
LIGHT: one L, one E, physical shadow/background response, T, and optional A.
RENDER: one G plus one D, only when either differs from source.
SKIN: one scale-aware S behavior plus one source-consistent P finish.
AVOID: only the two or three failures most likely for this source.
G0 + D0; add RENDER only for a requested grade/device. Target 55–110 English words, with an absolute ceiling of 135 for combined relight and capture-style edits.cinematic, editorial, HDR, film, DSLR, medium format, or smartphone into visible exposure, palette, tonal, microcontrast, sharpening, and dynamic-range behavior.E0 + G0 + D0. Never mix multiple device profiles or color looks. Never claim exact manufacturer color science.deep, near-black, or hard contrast only when the user explicitly selects backlight, hard light, low-key, neon, or silhouette behavior.Every handoff must use this structure with no placeholders.
Keep six source-defined groups stable: face outline/proportions; feature spacing, shape, and size; hairline, parting, and hair mass; source-identifying skin anchors; makeup/accessories; and apparent age/expression. Do not describe these groups in detail to the image model unless a real failure requires a shorter identity retry. Detailed identity checks belong in validation, not the generation prompt.
Under A6, internal features are intentionally hidden. Judge identity from hair/head/body outline, head-to-body ratio, pose, position, and framing.
fair, whiter, or beauty-grade language unless the user explicitly requests a complexion change.optical-restyle is explicit. If optics change, state the visible consequence rather than lens numbers alone.Retain orientation, aspect ratio, composition, focal plane, depth of field, and subject-to-frame scale. A backend may downscale uniformly; exact pixel dimensions are not required. If a local result exists, run the read-only check:
python3 "$XXG_SKILL_DIR/scripts/check_aspect_ratio.py" SOURCE_IMAGE EDITED_IMAGE
Accept relative aspect-ratio drift of ≤5%. Never resize, crop, pad, or extend locally to force a pass.
After generation, read the V2.2 identity and detail audit. At normal size first, verify:
If a result is nearly unchanged, strengthen one observable target. If skin becomes artificial, replace SKIN with clean continuous source skin tone; bounded source-shaped highlights; faint region-specific microdetail only where focus and light resolve it. Never present a failed image as final.
references/prompt-recipes.md and references/lighting-skin-color-temperature-recipes.mdreferences/tone-exposure-style-device-recipes.mdreferences/backend-and-clean-realism.mdreferences/identity-and-detail-audit.mdreferences/edit-plan-and-protection.mdPopular skills
Works with
Claude, Codex, Cursor & more