500 byte images: the Haiku Vector Icon Format

Haiku uses a custom vector image format to store icons. This is surprising both because most OSes consider bitmaps to be totally sufficient to represent icons and because there are plenty of vector graphics formats out this (e.g. SVG). The goal of the Haiku Vector Icon Format (HVIF) is to make vector icon files as small as possible. This allows Haiku to display icons as several sizes while still keeping the files small enough to fit into an inode (i.e., inside a file’s metadata). The goal of keeping the icons in the metadata is to reduce the disk reads needed to display a folder – it also each file to only require one disk read to display.

This blog post examines the details of the HVIF format using a hex editor and the canonical parser’s source code. In the process of dissecting an example icon, I’ll also show you an optimization bug in the icon image editor.

Great article.

54 Comments

  1. 2016-09-04 5:17 am
    • 2016-09-04 6:49 am
    • 2016-09-04 7:05 am
      • 2016-09-04 11:50 pm
    • 2016-09-04 7:09 am
      • 2016-09-05 8:33 am
    • 2016-09-04 7:10 am
      • 2016-09-04 8:48 am
      • 2016-09-04 11:56 am
  2. 2016-09-04 11:30 am
    • 2016-09-04 9:56 pm
      • 2016-09-05 6:31 am
        • 2016-09-05 8:06 am
        • 2016-09-05 8:14 am
  3. 2016-09-04 11:42 am
  4. 2016-09-04 11:57 am
    • 2016-09-04 1:34 pm
      • 2016-09-04 2:00 pm
        • 2016-09-04 3:13 pm
        • 2016-09-06 5:50 am
      • 2016-09-04 4:55 pm
      • 2016-09-04 5:14 pm
        • 2016-09-04 6:17 pm
          • 2016-09-04 7:06 pm
      • 2016-09-07 8:03 am
    • 2016-09-05 1:39 pm
  5. 2016-09-04 4:58 pm
    • 2016-09-04 6:03 pm
      • 2016-09-04 8:16 pm
      • 2016-09-05 4:18 am
        • 2016-09-05 4:34 am
          • 2016-09-05 6:07 am
          • 2016-09-05 8:34 am
          • 2016-09-05 12:23 pm
          • 2016-09-05 3:22 pm
          • 2016-09-06 2:35 am
          • 2016-09-06 7:20 pm
      • 2016-09-06 5:30 pm
        • 2016-09-08 3:59 pm
  6. 2016-09-04 5:28 pm
    • 2016-09-04 8:05 pm
      • 2016-09-05 8:22 am
      • 2016-09-05 1:31 pm
        • 2016-09-06 5:59 am
  7. 2016-09-05 12:17 am
    • 2016-09-05 12:34 am
    • 2016-09-05 12:48 am
      • 2016-09-05 5:15 pm
      • 2016-09-05 8:30 pm
        • 2016-09-05 10:07 pm
  8. 2016-09-06 9:30 am
    • 2016-09-06 12:55 pm
      • 2016-09-06 1:48 pm
        • 2016-09-06 3:11 pm