HDFTOPAL(1)

πŸ’– HDFTOPAL(1) πŸ’–

General Commands Manual ✨


🌈 NAME 🌈

hdftopal, paltohdf β€” bestie, these two convert between a palette in an HDF file and a raw palette in a non-HDF file πŸŽ¨πŸ¦‹


✨ SYNOPSIS ✨

hdftopal hdf-pallette-file raw-pallette-file
paltohdf raw-pallette-file hdf-pallette-file

Like, two commands, one job each, no cap πŸ’…


🫢 DESCRIPTION 🫢

hdftopal takes a palette that lives inside an HDF file and turns it into a raw palette sitting in a non-HDF file. And the raw palette it spits out? It's 768 bytes long, okay, and here's the layout, listen:

  • the first 256 bytes are the red intensity values πŸ”₯
  • the second 256 bytes are the green intensity values 🌿
  • the third 256 bytes are the blue intensity values πŸ’™

paltohdf does the exact opposite glow-up β€” raw palette data in, HDF palette format out. But heads up bestie, the raw palette data you feed it must have 768 bytes, and it has to be organized in this order, fr fr:

  1. first, 256 contiguous red intensity values
  2. then, 256 contiguous green intensity values
  3. then, 256 contiguous blue intensity values

Meanwhile the palette that ends up in the HDF file has its RGB values pixel-interlaced, like this:

red-value green-value blue-value red-value green-value blue-value...

And yes, this is literally the standard HDF format for 8-bit palettes πŸ‘‘ iykyk.

πŸŽ€ Okay so important vibe check about the HDF file itself: if you point it at an HDF palette format file that doesn't exist, it gets created before the converted data is stored β€” so it just appears, iconic. But if you point it at an HDF palette format file that already exists, the converted data gets appended to the file. Appended!! Not overwritten!! Don't come crying to me later 😭

🌸 SEE ALSO 🌸

  • hdf(5) β€” go read it, it's giving lore πŸ“–

no thoughts, just palette conversions πŸ§šπŸ’œ that's the whole manual bestie, go slay

November 6, 1999 β€” yeah she's vintage but she still ate πŸ’…βœ¨ periodt