← 返回
未分类

怀旧照片修复

This skill should be used when the user wants to restore and enhance old or vintage photographs. Trigger this skill when the user mentions "old photo", "vintage photo", "photo restoration", "修复老照片", "照片修复", or similar phrases involving fixing damaged or faded photographs, especially when facial enhancement, color correction, or overall image improvement is needed.
This skill should be used when the user wants to restore and enhance old or vintage photographs. Trigger this skill when the user mentions "old photo", "vintage photo", "photo restoration", "修复老照片", "照片修复", or similar phrases involving fixing damaged or faded photographs, especially when facial enhancement, color correction, or overall image improvement is needed.
user_b92bbb94
未分类 community v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 12
下载
💾 0
安装
1
版本
#latest

概述

Old Photo Restoration

Overview

This skill enables AI-powered restoration and enhancement of old, damaged, or faded photographs using advanced image processing techniques and AI models.

When to Use This Skill

Use this skill when the user requests:

  • Restoration of old or vintage photographs
  • Enhancement of faded or discolored images
  • Face recognition and enhancement in old photos
  • Color correction or colorization of black and white photos
  • Repair of scratches, tears, or other damage in photographs
  • General improvement of image quality in vintage photos

Workflow

Step 1: Analyze the Photo

First, assess the photo's condition:

  1. Identify issues:
    • Fading or discoloration
    • Scratches, tears, or physical damage
    • Blurriness or noise
    • Missing parts or torn edges
    • Color casts (yellowish, reddish tones)
  1. Detect faces:
    • Count the number of faces
    • Identify face positions and orientations
    • Assess face quality (occlusion, blur, lighting)
    • Note any facial damage or distortion
  1. Determine restoration needs:
    • Is colorization needed? (black and white photos)
    • Is facial enhancement required?
    • What level of detail restoration is needed?
    • Are there specific areas requiring special attention?

Step 2: Choose Enhancement Approach

Based on analysis, select appropriate techniques:

For Color Issues:

  • Use color correction algorithms
  • Apply histogram equalization
  • Adjust white balance
  • For black and white photos, consider AI-based colorization

For Facial Enhancement:

  • Apply face detection using OpenCV or similar
  • Use AI-based face restoration models (e.g., CodeFormer, GFPGAN)
  • Enhance facial features while preserving identity
  • Smooth skin texture naturally

For Damage Repair:

  • Use inpainting algorithms for small scratches
  • Apply denoising filters
  • Use content-aware fill for missing areas
  • Blend restored areas seamlessly

Step 3: Execute Restoration

  1. Preprocessing:
    • Normalize image brightness and contrast
    • Apply basic denoising
    • Correct geometric distortions if present
  1. Face Enhancement (if faces detected):
    • Detect all faces in the image
    • Extract face regions
    • Apply face restoration model
    • Blend enhanced faces back into original image
  1. Color Correction:
    • Analyze color distribution
    • Remove unwanted color casts
    • Enhance contrast and saturation
    • Preserve natural skin tones
  1. Detail Enhancement:
    • Apply sharpening filters appropriately
    • Enhance texture details
    • Reduce noise without losing important details

Step 4: Post-Processing

  1. Review the result:
    • Compare before and after
    • Check for artifacts or unnatural enhancements
    • Ensure faces still look natural and recognizable
  1. Fine-tune adjustments:
    • Adjust enhancement intensity if needed
    • Balance between restoration and preservation of vintage feel
    • Apply final touches (cropping, slight brightness adjustments)
  1. Output formats:
    • Save in high-quality format (PNG or high-JPEG quality)
    • Consider saving both before and after versions
    • Document the restoration process if requested

Using the Script

This skill includes a Python script for automated photo restoration:

scripts/restore_photo.py <input_image> [options]

Options:

  • --enhance-faces: Enable facial enhancement using AI models
  • --color-correct: Apply automatic color correction
  • --colorize: Convert black and white to color (experimental)
  • --remove-scratches: Attempt to remove small scratches and damage
  • --output : Specify output file path
  • --intensity <0-1>: Enhancement intensity (default: 0.7)

Examples:

Basic restoration with face enhancement:

python scripts/restore_photo.py old_photo.jpg --enhance-faces --output restored_photo.jpg

Full restoration with all features:

python scripts/restore_photo.py vintage.png --enhance-faces --color-correct --remove-scratches --intensity 0.8

Colorize black and white photo:

python scripts/restore_photo.py bw_photo.jpg --colorize --output colorized.jpg

Resources

scripts/

restore_photo.py - Main restoration script that:

  • Loads and analyzes input images
  • Detects faces using OpenCV
  • Applies AI-based face restoration
  • Performs color correction and enhancement
  • Outputs restored images with customizable options

Requirements: The script requires Python packages:

  • OpenCV (cv2)
  • NumPy
  • Pillow (PIL)
  • Optional: face restoration model dependencies

references/

image_processing_techniques.md - Detailed documentation on:

  • Image preprocessing methods
  • Color correction algorithms
  • Face detection and enhancement techniques
  • Best practices for photo restoration

model_installation.md - Guide for installing AI models:

  • Face restoration model setup
  • Model download instructions
  • Performance optimization tips

assets/

This directory is not needed for this skill as all processing is handled programmatically.

Best Practices

  1. Preserve Originality: Always keep the original image file. Restoration should enhance, not erase, the photo's history.
  1. Natural Enhancement: Avoid over-enhancement. Subtle improvements often produce better results than aggressive processing.
  1. Test Incrementally: Apply changes step-by-step and review after each step to ensure the desired effect.
  1. Face Recognition Priority: For photos with identifiable people, prioritize maintaining facial features and expressions over other enhancements.
  1. Quality Trade-offs: Balance between enhancement quality and processing time. Higher quality may require more computational resources.
  1. Multiple Versions: Consider creating different versions with varying enhancement levels, allowing the user to choose the best result.

Common Scenarios

Scenario 1: Faded Family Photo

  • Detect faces for enhancement
  • Apply color correction to remove yellowing
  • Increase contrast subtly
  • Preserve original composition

Scenario 2: Black and White Portrait

  • Use AI colorization
  • Enhance facial details
  • Ensure natural skin tones
  • Maintain vintage character

Scenario 3: Damaged Photo with Scratches

  • Remove small scratches via inpainting
  • Enhance damaged areas
  • Apply overall denoising
  • Blend restored sections carefully

Scenario 4: Multiple Group Photo

  • Detect and enhance all faces
  • Balance lighting across faces
  • Apply uniform color correction
  • Ensure consistent enhancement

Limitations

  • Face recognition works best with frontal faces. Profile or partially occluded faces may have limited enhancement.
  • Extreme damage (large tears, missing sections) may require manual editing beyond automated tools.
  • Colorization accuracy depends on AI model training and may not always match historical reality.
  • Very low-resolution images may have limited enhancement potential.
  • Over-enhancement can create unnatural artifacts; use conservative intensity settings.

Troubleshooting

No faces detected: Check image quality and lighting. Ensure faces are visible and not extremely small in the frame.

Unnatural colors: Reduce color correction intensity or manually adjust white balance parameters.

Over-smoothed faces: Lower the enhancement intensity to preserve natural texture and details.

Artifacts in restored areas: Reduce overall enhancement intensity or adjust specific parameters for problematic areas.

Processing too slow: For large images, consider resizing before processing or reduce enhancement intensity.

Notes

  • Always obtain consent before enhancing photos of people, especially for sharing or public use.
  • Consider the historical context of vintage photos; sometimes preserving age signs is more appropriate than removing them completely.
  • Batch processing of multiple photos is supported through the script's command-line interface.
  • The restoration quality depends on the original image quality and the extent of damage.

版本历史

共 1 个版本

  • v1.0.0 Initial release 当前
    2026-06-09 11:06 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-agent

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,376 📥 320,195
ai-agent

self-improving agent

pskoett
捕获经验教训、错误及修正内容,以实现持续改进。适用于以下场景:(1)命令或操作意外失败;(2)用户纠正Claude(如“不,那不对……”“实际上……”);(3)用户请求的功能不存在;(4)外部API或工具出现故障;(5)Claude发现自身
★ 4,078 📥 808,678
ai-agent

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,225 📥 267,663