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

增强工作流程

  1. Analyze - Check resolution, sharpness, artifacts
  2. Enhance - Apply appropriate improvements
  3. Optimize - Adjust for intended use case
  4. Save - Preserve original, save enhanced version
  1. 分析 - 检查分辨率、清晰度和伪影
  2. 增强 - 应用合适的优化手段
  3. 适配 - 根据使用场景调整参数
  4. 保存 - 保留原文件,另存增强后的版本

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.size
python
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.size

Usage

使用示例

enhance_image('screenshot.png', 'screenshot-enhanced.png')
undefined
enhance_image('screenshot.png', 'screenshot-enhanced.png')
undefined

ImageMagick Commands

ImageMagick 命令

bash
undefined
bash
undefined

Sharpen 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
undefined
for f in *.png; do convert "$f" -sharpen 0x1 "enhanced-$f" done
undefined

Optimization by Use Case

按使用场景优化参数

Use CaseResolutionFormatQuality
Web/Blog1920px widePNG/WebP85-95%
Social MediaPlatform-specificJPG90%
Presentations2560px+PNG95%
Print300 DPI minimumPNG/TIFF100%
使用场景分辨率格式质量
网页/博客宽1920pxPNG/WebP85-95%
社交媒体平台特定尺寸JPG90%
演示文稿2560px以上PNG95%
印刷最低300 DPIPNG/TIFF100%

Social Media Sizes

社交媒体图片推荐尺寸

PlatformRecommended Size
Twitter1200x675
LinkedIn1200x627
Instagram1080x1080
Facebook1200x630
平台推荐尺寸
Twitter1200x675
LinkedIn1200x627
Instagram1080x1080
Facebook1200x630

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
undefined
bash
undefined

Python

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
undefined
pip install opencv-python
undefined