Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Brotli is excellent at text and does a great job at compressing overall, but FLIF is written directly to excel at lossless image compression, hence FLIF will be much better unless it's a really poor solution (which results show it's certainly not).

Likewise Brotli will not beat FLAC at compressing audio, since FLAC is specifically written to do that.



Actually, FLAC doesn't have a very good compression ratio (e.g. see [1]). It does have features that are very important for audio streams: it can be quickly resynced and AFAIK decompression proceeds at nearly-constant speed.

[1] https://news.ycombinator.com/item?id=7893171


Even so, I would be very surprised if FLAC did not outperform general purpose compressors if the test is done on a wider range of music than a single piano piece (which should be very compressable overall as audio goes).

edit: went and did a test on a couple of tracks, using brotli: bro --quality 11 --window 24 against flac -8 (best settings in both cases)

  satie - gymnopedie no 1:
  wav: 41.6mb
  brotli: 28.1mb
  flac: 14.7mb

  ram jam - black betty:
  wav: 41.8
  brotli: 35.8
  flac: 26.5

  vangelis - tao of love:
  wav: 29.4
  brotli: 23.0
  flac: 13.4

  meat load - paradise by the dashboard light:
  wav: 89.3
  brotli: 78.3
  flac: 58.5
certainly not a massive test, and there are likely general purpose compressors which does a better job than brotli, still I feel rather convinced that they will not do better than FLAC other than in extreme cases such as the piano piece you linked to.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: