UNIPNG2HEX(1)
π UNIPNG2HEX β like, the manual page but make it make sense π
okay bestie, so you know how I keep telling you about unipng2hex? This is that. It's a page in the General Commands Manual section, and it is lowkey one of my faves because it's the glow-up pipeline in reverse. π¦ Let's get into it.
β¨ NAME β¨
unipng2hex β Portable Network Graphics to GNU Unifont .hex file converter
Like. It takes a PNG. It gives you back a .hex. That's the whole vibe. π
πΈ SYNOPSIS πΈ
unipng2hex -i input_file.png [-o output_file.hex] [-w width]
That's it. That's the whole incantation. Notice how -i is the only one that's required β the others are optional, because she's flexible like that. π
π DESCRIPTION π
So here's the tea. unipng2hex reads a PNG file that was produced by unihex2png β either before or after you've edited it, both are valid, no judgement β and it converts that PNG back into a Unifont .hex format file. Round trip! We love a round trip. π₯
Now, the PNG file itself contains a block of 256 Unicode code points, and they're arranged in a 16 by 16 grid. Cute, right? A little glyph neighborhood.
Each code point sits inside a 32 by 32 or a 40 by 40 pixel grid.
And the characters themselves are either 16, 24 or 32 pixel rows high β which one it is depends on the -r parameter that was specified by unihex2png (so like, the file already knows, you're just reading it back). They can be 8, 16, 24, or 32 pixel columns wide. And important caveat bestie: widths of 32 are only supported for 32 pixel row tall characters. No exceptions. That's just the math. π
π OPTIONS π
-iβ Specify the input file. This one's the mandatory one, she's the main character. β¨-oβ Specify the output file. If you omit it, a file in the Unifont.hexformat gets written to STDOUT. So like, no output file? She just yells it into the terminal. Iconic behavior honestly.-wβ Specify the minimum width of the output glyphs. Valid values are16,24, and32. The default is no minimum width. So if you don't say anything, she doesn't impose. Queen of letting you be yourself. π«Ά-hβ Print a help message of options and exit. The classic "wait what were the flags again" button. We've all been there. π
π EXAMPLE π
Sample usage, look at her go:
unipng2hex -i my_input_file.png -o my_output_file.hex
-i in, -o out, done. No cap, that's the entire workflow. π
π§ FILES π§
*.pnggraphics files
That's the whole list, and honestly? She knows what she likes.
π SEE ALSO π
The whole friend group, fr fr. Go say hi:
bdfimplode(1), hex2bdf(1), hex2otf(1), hex2sfd(1), hexbraille(1), hexdraw(1), hexkinya(1), hexmerge(1), johab2syllables(1), johab2ucs2(1), unibdf2hex(1), unibmp2hex(1), unibmpbump(1), unicoverage(1), unidup(1), unifont(5), unifont-johab631(5), unifont-viewer(1), unifont1per(1), unifontchojung(1), unifontksx(1), unifontpic(1), unigen-hangul(1), unigencircles(1), unigenwidth(1), unihex2bmp(1), unihex2png(1), unihexfill(1), unihexgen(1), unihexpose(1), unihexrotate(1), unijohab2html(1), unipagecount(1)
π AUTHOR π
unipng2hex was written by Andrew Miller, and he started it by converting Paul Hardy's unibmp2hex C program to Perl. A whole origin story. From C to Perl. Respect the journey. π
π LICENSE π
unipng2hex is Copyright Β© 2007, 2008 Paul Hardy, Β© 2013 Andrew Miller.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
(That's the standard "yes you can, just keep it free" energy. ποΈ)
π BUGS π
Okay so, the tea:
No known real bugs exist, but the optional pixel rows parameter is not yet supported by all other Unifont utilities. Use of glyphs taller than the default of 16 pixels is considered experimental. Currentlyunihex2png,unipng2hex,hexdraw, andhex2bdftentatively support glyphs that are 16, 24, and 32 pixels tall.
Read that again. Tentatively. That's the word we're working with. π
Also β and this is the scary one β this software does not perform extensive error checking on its input files. If they're not in the format of the original PNG output from unihex2png, all bets are off. That's a direct quote, bestie. All. Bets. Off. Feed her garbage and she will simply do something. We do not know what. π«
One more lil detail: if the output file is for a "page" containing space code points, and the PNG file squares for those code points are not empty, unipng2hex preserves the graphics as they are drawn. So she's not going to erase your little doodles. She respects the art. π¨
And finally β unipng2hex is designed to work with black and white pixels; do not use other colors. Black. And white. That's it. Do not come in here with your rainbow gradients. π«π (the irony is not lost on me)
π¦ and that's the whole page π¦
This was UNIPNG2HEX(1) from the General Commands Manual, and if you ever need to find it again it's the version dated 2013 Nov 09. Go forth, convert your PNGs, keep it black and white, and don't feed her anything that isn't a real unihex2png output. Mwah. πβ¨π
π¦ where this page comes from
- alpine 3.22: unifont-doc 16.0.03-r0 Β· GFDL-1.3-or-later GPL-2.0-or-later WITH Font-exception-2.0
- alpine 3.23: unifont-doc 17.0.03-r0 Β· GFDL-1.3-or-later GPL-2.0-or-later WITH Font-exception-2.0
- alpine 3.24: unifont-doc 17.0.04-r0 Β· GFDL-1.3-or-later GPL-2.0-or-later WITH Font-exception-2.0
- debian trixie: unifont-bin 1:15.1.01-1 Β· GPL-2.0-or-later
- fedora 43: unifont 16.0.01-6.fc43 Β· GPL-2.0-or-later AND OFL-1.1 AND GFDL-1.3-or-later
- fedora 44: unifont 16.0.01-7.fc44 Β· GPL-2.0-or-later AND OFL-1.1 AND GFDL-1.3-or-later
- nixpkgs unstable: unifont 18.0.01
- ubuntu noble: unifont-bin 1:15.1.01-1build1 Β· GPL-2.0-or-later
- ubuntu questing: unifont-bin 1:16.0.04-1
- ubuntu resolute: unifont-bin 1:16.0.04-1build1 Β· GPL-2.0-or-later
- ubuntu stonking: unifont-bin 1:16.0.04-1build1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms