COMPFACE(3)

πŸ“¦
version 1.5.2 Β· 2 versions
  • 1.5.2 Β· debian bookworm, debian trixie, fedora 43, fedora 44, opensuse-leap 16.0, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 1.5.2 Β· arch rolling
, in debian bookworm, debian trixie, fedora 43, fedora 44, opensuse-leap 16.0, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– COMPFACE β€” the manual, bestie edition ✨

okay so this is the page for compface and uncompface β€” two lil library functions that squish and un-squish 48x48x1 face image files. yes, literally faces. we're doing face compression. iconic behavior honestly 🫢


🌸 NAME 🌸

compface, uncompface β€” compress and expand 48x48x1</> face image files πŸ’…


✨ SYNOPSIS ✨

compface (buf)

uncompface (buf)

char *buf

no cap, that's the whole thing. two functions, one char *buf, that's the vibe πŸ’œ


πŸŽ€ DESCRIPTION πŸŽ€

so compface is the function that generates highly compressed representations of 48x48x1 face image files. and uncompface is its inverse function β€” it does the inverse transformation with no loss of data. zero. none. the data comes back exactly how it left, periodt πŸ’―

the algorithm is highly tuned for this specific purpose and it achieves better than a five to one compression ratio on average. she's efficient, she's focused, she ate πŸ”₯

in both functions: input comes in via a NULL terminated string, and a NULL terminated output string gets written over the input string. so heads up bestie β€”

buf should point to a block of 2K size or more to avoid buffer overruns during output generation. like, actually. don't skimp on the buffer. the output writes on top of the input and she needs room 🚨

πŸ¦‹ the formats πŸ¦‹

the input format for compface (and the output format for uncompface) is:

  • 48 lines
  • each of 3 sixteen bit hexadecimal integers
  • comma terminated
  • in C initialiser style

the output format of compface (and the input format for uncompface) is:

  • some number of lines
  • made up of a space followed by printable characters
  • those characters are in the range !'' to ~'' inclusive
  • the first line contains 72 characters
  • following lines contain 79 characters
  • except the last line may be short

🌈 the XBM glow-up 🌈

this version of compface has been patched to also be able to handle normal XBM images. and uncompface will produce XBM output only if the -X switch is applied. no -X, no XBM. that's the rule πŸ’…

πŸ“ how much does it actually shrink πŸ“

the amount of compression obtained varies between face image files β€” it's not one fixed number, okay β€” but the output of compface averages less than 200 characters. and the average number of output lines is three. three lines. for a whole face. we love a compact queen πŸ‘‘


πŸ’€ DIAGNOSTICS πŸ’€

the return value is normally 0. here's the whole mood ring:

  • 0 β€” normal, we're chilling, everything slayed ✨
  • 1 β€” returned if extra input has been ignored during a compress operation. she noticed, she just didn't say anything πŸ™ˆ
  • -1 β€” returned in the case of an invalid input format 🚨
  • -2 β€” returned if an internal buffer overrun occurs 😭
bestie. if you get -2, something went very wrong internally. check your buffer size. i'm just saying. 🫢

πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page!! this version of the compface manual is dated 25 January 1990 and lives in the Library Functions Manual section as COMPFACE(3) β€” old money, still relevant, we stan a legacy icon πŸŽ€

stay compressed, stay lossless, and please give buf at least 2K πŸ’–βœ¨πŸ¦‹