I

Image Enhancer System

Enterprise-grade skill for improves, quality, images, especially. Includes structured workflows, validation checks, and reusable patterns for media.

SkillClipticsmediav1.0.0MIT
0 views0 copies

Image Enhancer System

A practical skill for improving image quality programmatically — covering resolution upscaling, sharpening, noise reduction, color correction, contrast enhancement, and batch processing for screenshots, photos, and web assets.

When to Use This Skill

Choose Image Enhancer System when you need to:

  • Upscale low-resolution images for print or high-DPI displays
  • Sharpen blurry screenshots for documentation
  • Reduce noise in low-light photographs
  • Apply consistent color correction across a batch of images
  • Optimize images for web performance without visible quality loss

Consider alternatives when:

  • You need AI-generated images (use an image generation skill)
  • You need graphic design or composition (use a design skill)
  • You need video enhancement (use a video processing skill)

Quick Start

# Install image processing dependencies pip install Pillow opencv-python
from PIL import Image, ImageEnhance, ImageFilter def enhance_image(input_path, output_path): img = Image.open(input_path) # Sharpen img = img.filter(ImageFilter.SHARPEN) # Enhance contrast enhancer = ImageEnhance.Contrast(img) img = enhancer.enhance(1.2) # 20% more contrast # Enhance color saturation enhancer = ImageEnhance.Color(img) img = enhancer.enhance(1.1) # 10% more vibrant # Enhance brightness slightly enhancer = ImageEnhance.Brightness(img) img = enhancer.enhance(1.05) # 5% brighter img.save(output_path, quality=95) print(f"Enhanced: {input_path}{output_path}") enhance_image("screenshot.png", "screenshot_enhanced.png")

Core Concepts

Enhancement Operations

OperationPurposeLibrary/Tool
SharpeningIncrease edge definitionPIL ImageFilter
ContrastImprove tonal rangePIL ImageEnhance
Noise ReductionRemove grain/artifactsOpenCV fastNlMeans
UpscalingIncrease resolutionOpenCV/Pillow resize
Color CorrectionFix white balance, saturationPIL ImageEnhance
CompressionReduce file sizePIL save quality

Advanced Enhancement with OpenCV

import cv2 import numpy as np def advanced_enhance(input_path, output_path): img = cv2.imread(input_path) # Denoise denoised = cv2.fastNlMeansDenoisingColored( img, None, 10, 10, 7, 21 ) # CLAHE (Contrast Limited Adaptive Histogram Equalization) lab = cv2.cvtColor(denoised, cv2.COLOR_BGR2LAB) l, a, b = cv2.split(lab) clahe = cv2.createCLAHE(clipLimit=2.0, tileGridSize=(8, 8)) l = clahe.apply(l) enhanced = cv2.merge([l, a, b]) result = cv2.cvtColor(enhanced, cv2.COLOR_LAB2BGR) # Sharpen with unsharp mask gaussian = cv2.GaussianBlur(result, (0, 0), 3) sharpened = cv2.addWeighted(result, 1.5, gaussian, -0.5, 0) cv2.imwrite(output_path, sharpened) advanced_enhance("photo.jpg", "photo_enhanced.jpg")

Batch Processing

from pathlib import Path from PIL import Image, ImageEnhance, ImageFilter def batch_enhance(input_dir, output_dir, settings=None): defaults = { "sharpen": True, "contrast": 1.15, "color": 1.1, "brightness": 1.0, "quality": 90, } s = {**defaults, **(settings or {})} Path(output_dir).mkdir(exist_ok=True) processed = 0 for img_path in Path(input_dir).glob("*"): if img_path.suffix.lower() not in (".jpg", ".jpeg", ".png", ".webp"): continue img = Image.open(img_path) if s["sharpen"]: img = img.filter(ImageFilter.SHARPEN) for attr in ("contrast", "color", "brightness"): if s[attr] != 1.0: enhancer = getattr(ImageEnhance, attr.capitalize())(img) img = enhancer.enhance(s[attr]) out_path = Path(output_dir) / img_path.name img.save(out_path, quality=s["quality"]) processed += 1 print(f"Enhanced {processed} images → {output_dir}") batch_enhance("./raw_images", "./enhanced_images")

Configuration

ParameterDescriptionExample
sharpenApply sharpening filtertrue
contrastContrast multiplier (1.0 = no change)1.2
colorColor saturation multiplier1.1
brightnessBrightness multiplier1.05
denoiseApply noise reductiontrue
qualityJPEG output quality (1-100)90

Best Practices

  1. Enhance in the right order: denoise → color correct → contrast → sharpen — Sharpening before denoising amplifies noise. Color correction after contrast adjustment produces different results than before. Follow the standard pipeline order for predictable results.

  2. Use subtle enhancement values — Contrast at 1.15-1.25 looks natural; at 1.5 it looks processed. Saturation at 1.1 adds vibrancy; at 1.4 it looks cartoonish. Less is more — the best enhancement is one the viewer doesn't notice.

  3. Always preserve the original file — Save enhanced images to a separate directory or with a suffix. Over-processing an image is irreversible, and you may need to re-enhance with different settings later.

  4. Match output format to purpose — Use PNG for screenshots (lossless, supports transparency), JPEG at 85-95% quality for photos (good compression), and WebP for web delivery (best size-to-quality ratio).

  5. Profile your batch processing for large sets — Processing thousands of images sequentially is slow. Use Python's multiprocessing or batch tools like ImageMagick's mogrify for parallel processing on large image sets.

Common Issues

Enhanced images have visible halos around edges — Over-sharpening creates bright/dark halos at high-contrast edges. Reduce the sharpening amount or use unsharp mask with a smaller radius. If using OpenCV's addWeighted for sharpening, reduce the weight from 1.5 to 1.2.

Color correction looks different on different screens — Enhancement that looks good on your calibrated monitor may look oversaturated on a phone. Test enhanced images on at least two different devices before batch processing. When in doubt, be conservative with color adjustments.

Batch processing runs out of memory — Loading many high-resolution images simultaneously exhausts RAM. Process images one at a time, close each image after saving, and use del img or img.close() explicitly. For very large images, consider processing in tiles.

Community

Reviews

Write a review

No reviews yet. Be the first to review this template!

Similar Templates