image-enhancement
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese<!-- Adapted from: awesome-claude-skills/image-enhancer -->
<!-- 改编自: awesome-claude-skills/image-enhancer -->
Image Enhancement Guide
图像增强指南
Improve image quality for documentation, presentations, and social media.
提升用于文档、演示文稿和社交媒体的图像质量。
When to Use
适用场景
- Improving screenshot quality for blog posts
- Enhancing images for social media
- Preparing images for presentations
- Upscaling low-resolution images
- Sharpening blurry photos
- Cleaning up compressed images
- 提升博客文章所用截图的质量
- 增强社交媒体配图的效果
- 为演示文稿准备优质图片
- 放大低分辨率图片
- 锐化模糊的照片
- 修复压缩后的图像瑕疵
Enhancement Workflow
增强工作流程
- Analyze - Check resolution, sharpness, artifacts
- Enhance - Apply appropriate improvements
- Optimize - Adjust for intended use case
- Save - Preserve original, save enhanced version
- 分析 - 检查分辨率、清晰度和伪影
- 增强 - 应用合适的优化手段
- 适配 - 根据使用场景调整参数
- 保存 - 保留原文件,另存增强后的版本
Python Enhancement Script
Python 增强脚本
python
from PIL import Image, ImageEnhance, ImageFilter
def enhance_image(input_path, output_path):
img = Image.open(input_path)
# Upscale if small
if img.width < 1920:
scale = 1920 / img.width
new_size = (int(img.width * scale), int(img.height * scale))
img = img.resize(new_size, Image.LANCZOS)
# Sharpen
img = img.filter(ImageFilter.SHARPEN)
# Enhance contrast slightly
enhancer = ImageEnhance.Contrast(img)
img = enhancer.enhance(1.1)
img.save(output_path, quality=95)
return img.sizepython
from PIL import Image, ImageEnhance, ImageFilter
def enhance_image(input_path, output_path):
img = Image.open(input_path)
# 若图片尺寸过小则放大
if img.width < 1920:
scale = 1920 / img.width
new_size = (int(img.width * scale), int(img.height * scale))
img = img.resize(new_size, Image.LANCZOS)
# 锐化处理
img = img.filter(ImageFilter.SHARPEN)
# 轻微提升对比度
enhancer = ImageEnhance.Contrast(img)
img = enhancer.enhance(1.1)
img.save(output_path, quality=95)
return img.sizeUsage
使用示例
enhance_image('screenshot.png', 'screenshot-enhanced.png')
undefinedenhance_image('screenshot.png', 'screenshot-enhanced.png')
undefinedImageMagick Commands
ImageMagick 命令
bash
undefinedbash
undefinedSharpen image
锐化图像
convert input.png -sharpen 0x1 output.png
convert input.png -sharpen 0x1 output.png
Upscale 2x with good quality
以高质量放大2倍
convert input.png -resize 200% -filter Lanczos output.png
convert input.png -resize 200% -filter Lanczos output.png
Remove compression artifacts
去除压缩伪影
convert input.jpg -enhance output.jpg
convert input.jpg -enhance output.jpg
Batch process folder
批量处理文件夹内文件
for f in *.png; do
convert "$f" -sharpen 0x1 "enhanced-$f"
done
undefinedfor f in *.png; do
convert "$f" -sharpen 0x1 "enhanced-$f"
done
undefinedOptimization by Use Case
按使用场景优化参数
| Use Case | Resolution | Format | Quality |
|---|---|---|---|
| Web/Blog | 1920px wide | PNG/WebP | 85-95% |
| Social Media | Platform-specific | JPG | 90% |
| Presentations | 2560px+ | PNG | 95% |
| 300 DPI minimum | PNG/TIFF | 100% |
| 使用场景 | 分辨率 | 格式 | 质量 |
|---|---|---|---|
| 网页/博客 | 宽1920px | PNG/WebP | 85-95% |
| 社交媒体 | 平台特定尺寸 | JPG | 90% |
| 演示文稿 | 2560px以上 | PNG | 95% |
| 印刷 | 最低300 DPI | PNG/TIFF | 100% |
Social Media Sizes
社交媒体图片推荐尺寸
| Platform | Recommended Size |
|---|---|
| 1200x675 | |
| 1200x627 | |
| 1080x1080 | |
| 1200x630 |
| 平台 | 推荐尺寸 |
|---|---|
| 1200x675 | |
| 1200x627 | |
| 1080x1080 | |
| 1200x630 |
Tips
小贴士
- Always keep original files as backup
- PNG for screenshots (lossless)
- JPG for photos (smaller size)
- WebP for web (best compression)
- Batch process for multiple files
- 始终保留原文件作为备份
- 截图使用PNG格式(无损压缩)
- 照片使用JPG格式(文件更小)
- 网页使用WebP格式(最佳压缩比)
- 多文件时使用批量处理
Required Tools
所需工具
bash
undefinedbash
undefinedPython
Python 库
pip install Pillow
pip install Pillow
ImageMagick
ImageMagick
sudo apt-get install imagemagick
sudo apt-get install imagemagick
For advanced upscaling
用于高级放大
pip install opencv-python
undefinedpip install opencv-python
undefined