🍋
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.

技術的詳細

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.

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

関連フォーマット

関連ツール

関連用語