Receber por email
← Voltar para o catálogo

image-optimization

Optimizes images for web performance using modern formats, responsive techniques, and lazy loading strategies. Use when improving page load times, implementing responsive images, or preparing assets for production deployment.

178estrelas
Atualizado há 5 meses

Ver no GitHub ↗ Licença: MIT

Como adicionar

/plugin marketplace add secondsky/claude-skills

O comando exato pode variar conforme o repositório. Confira o README no GitHub.

Para o autor da skill

Cole no README do seu repo

Mostra que sua skill está catalogada na Skillteca, gera backlink e tráfego rastreável.

[![Skillteca](https://www.skillteca.com.br/api/badge/image-optimization-secondsky/svg)](https://www.skillteca.com.br/skills/image-optimization-secondsky)

Alerta por categoria

Receba novas skills de Design e Frontend toda segunda

1 email curto, só com as skills novas de Design e Frontend. 4 minutos de leitura, sem spam, cancela com 1 clique.

Você confirma o email no primeiro envio. Sem spam. Cancela com 1 clique.

Ler descrição completa

Image Optimization

Optimize images for web performance with modern formats and responsive techniques.

Format Selection

| Format | Best For | Compression | |--------|----------|-------------| | JPEG | Photos | Lossy, 50-70% reduction | | PNG | Icons, transparency | Lossless, 10-30% | | WebP | Modern browsers | 25-35% better than JPEG | | AVIF | Next-gen | 50% better than JPEG | | SVG | Logos, icons | Vector, scalable |

Responsive Images

<picture>
  <source srcset="image.avif" type="image/avif">
  <source srcset="image.webp" type="image/webp">
  <img
    src="image.jpg"
    srcset="image-400.jpg 400w, image-800.jpg 800w, image-1200.jpg 1200w"
    sizes="(max-width: 600px) 100vw, 50vw"
    alt="Description"
    loading="lazy"
    decoding="async"
  >
</picture>

Lazy Loading

<!-- Native lazy loading -->
<img src="image.jpg" loading="lazy" alt="Description">

<!-- With blur placeholder -->
<img
  src="placeholder-blur.jpg"
  data-src="image.jpg"
  class="lazy"
  alt="Description"
>

Build Pipeline (Sharp)

const sharp = require('sharp');

async function optimizeImage(input, output) {
  await sharp(input)
    .resize(1200, null, { withoutEnlargement: true })
    .webp({ quality: 80 })
    .toFile(output);
}

Performance Targets

| Asset Type | Target Size | |------------|-------------| | Hero image | <200KB | | Thumbnail | <30KB | | Total images | <500KB |

Optimization Checklist

  • [ ] Use WebP with JPEG fallback
  • [ ] Implement responsive srcset
  • [ ] Enable lazy loading for below-fold
  • [ ] Compress at quality 70-85
  • [ ] Serve from CDN
  • [ ] Set proper cache headers
Compartilhar X LinkedIn