{# 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

Lossless Compression

Lossless Compression (Reversible Data Reduction)

Lossless compression reduces file size without discarding any image data. The original image can be perfectly reconstructed from the compressed file. PNG, TIFF (with LZW), and WebP lossless use this approach.

Technical Detail

Lossless algorithms exploit statistical redundancy: PNG uses DEFLATE (LZ77 + Huffman coding) with row-level prediction filters. Typical compression ratios range from 2:1 to 10:1 depending on image complexity.

Example

```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);
```

Related Formats

Related Tools

Related Terms