UNIPNG2HEX(1)

πŸ“¦
version 17.0.04 Β· 3 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, debian trixie, fedora 43, fedora 44, nixpkgs unstable, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– 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 .hex format 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 are 16, 24, and 32. 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 🧚

  • *.png graphics 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. Currently unihex2png, unipng2hex, hexdraw, and hex2bdf tentatively 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