Image Optimization

by aj-geddes3f5182cfd739No license355 starsListed Oct 8, 2026Updated Oct 8, 2026Repository updated 7 months ago

Optimize images for web to reduce file size without sacrificing quality. Use compression, modern formats, and responsive techniques for faster loading.

Instructions onlyDesign & Creative
AI-generated overview

Guides web image optimization using compression, modern formats, and responsive image techniques.

What it does
This skill provides guidance for optimizing images for the web to reduce file size while preserving quality. It covers format selection (JPEG, PNG, WebP, SVG), compression settings, responsive image implementation, an optimization process, and monitoring best practices. It also includes a component template and reference guides, but ships no scripts.
When to use it
Use it when optimizing a website's images, implementing responsive images, improving page performance, or enhancing mobile experience, including before deployment.
Requirements
No scripts or tools are bundled; it is instructions and reference documents only. Following the guidance may involve external image tools such as ImageMagick, TinyJPEG, PNGQuant, OptiPNG, or cwebp, but none are required to read the skill.

Image Optimization

Table of Contents

Overview

Images typically comprise 50% of page weight. Optimization dramatically improves performance, especially on mobile networks.

When to Use

  • Website optimization
  • Responsive image implementation
  • Performance improvement
  • Mobile experience enhancement
  • Before deployment

Quick Start

Minimal working example:

yaml
Format Selection:
JPEG:  Best for: Photographs, complex images  Compression: Lossy (quality 70-85)  Size: ~50-70% reduction  Tools: ImageMagick, TinyJPEG  Command: convert image.jpg -quality 75 optimized.jpg
PNG:  Best for: Icons, screenshots, transparent images  Compression: Lossless  Size: 10-30% reduction  Tools: PNGQuant, OptiPNG  Command: optipng -o3 image.png
WebP:  Best for: Modern browsers (90% support)  Compression: 25-35% better than JPEG/PNG  Fallback: Use <picture> element  Tools: cwebp  Command: cwebp -q 75 image.jpg -o image.webp
SVG:  Best for: Icons, logos, simple graphics// ... (see reference guides for full implementation)

Reference Guides

Detailed implementations in the references/ directory:

GuideContents
Image Compression & Formats [blocked]Image Compression & Formats
Responsive Images [blocked]Responsive Images
Optimization Process [blocked]Optimization Process
Monitoring & Best Practices [blocked]Monitoring & Best Practices

Best Practices

✅ DO

  • Follow established patterns and conventions
  • Write clean, maintainable code
  • Add appropriate documentation
  • Test thoroughly before deploying

❌ DON'T

  • Skip testing or validation
  • Ignore error handling
  • Hard-code configuration values

Source and attribution

Source:aj-geddes/useful-ai-promptsinskills/image-optimizationat commit3f5182c

License: No license

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Report or request removal