{# canonical_base is the OWNING tenant's origin: all 16 Peasy domains serve the same catalogue, so a page rendered by a non-owner points its canonical at the owner instead of competing with it. Falls back to this site for static/self-owned pages. #}
🍋
Menu
Image

Lossy Compression

Lossy Compression (Perceptual Data Reduction)

Lossy compression achieves much smaller file sizes by permanently discarding image data that is less perceptible to human vision. JPEG, WebP lossy, and AVIF use this approach to achieve 10:1 to 50:1 compression ratios.

Detalle técnico

JPEG lossy compression applies DCT to 8x8 pixel blocks, then quantizes frequency coefficients based on quality settings. Higher quantization discards more high-frequency detail, reducing file size but introducing visible artifacts.

Ejemplo

```javascript
// Image compression via Canvas
canvas.toBlob(
  blob => console.log(`Size: ${(blob.size/1024).toFixed(0)} KB`),
  'image/jpeg',
  0.8  // quality: 0.0 (smallest) to 1.0 (best)
);

// WebP output (25-34% smaller than JPEG)
canvas.toBlob(cb, 'image/webp', 0.8);
```

Formatos relacionados

Herramientas relacionadas

Términos relacionados