PNGNQ(1)

πŸ“¦
version 1.1 Β· 3 versions
, in debian trixie, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ PNGNQ β€” ok bestie, let's talk quantizing ✨

Hiii so this is the pngnq manual page, section 1 of the User Manuals, and I'm literally obsessed with it. It's from MAY 2009 and it's giving "small tool, big slay". Sit down, grab a strawberry πŸ“, and let's go.


🌸 NAME 🌸

pngnq β€” quantize png images. That's the whole vibe. She shrinks your color palette and she does it gorgeously.


πŸŽ€ SYNOPSIS πŸŽ€

pngnq [-vfhV][-s sample_factor ][-Q dither ][-g gamma ][-e extension
][-d dir ][-n colors ][ inputfiles ]

Yeah okay it's a lot of brackets, don't panic, we're gonna walk through every single one of them below, no cap πŸ’…


πŸ’– DESCRIPTION πŸ’–

So here's the tea: pngnq takes a 32-bit RGBA PNG image and quantizes it down into an 8 bit RGBA palette PNG. It does this using the neuquant algorithm. Iconic. Efficient. We love her.

The output file name is literally just the input file name extended with -nq8.png β€” or whatever extension you told her to use instead.

And the input files? If you don't specify any, she defaults to standard input. And if she's processing standard input, the output goes straight to standard output. She's flexible like that πŸ¦‹


✨ OPTIONS ✨

Every flag, bestie, all of them, here we go:

  • -d dir β€” tells pngnq to put the output files in a directory other than the one your input files are already chilling in. Relocation era πŸ’…
  • -e extension β€” specifies the new filename extension. Defaults to -nq8.png. Important: pngnq drops .png from the original filenames. And uh, heads up: if you set the argument of the -e option to .png and you choose the -f option, then the input file will be overwritten. That's not a drill, that's your original file, gone, bye. Be careful 🫢
  • -f β€” force overwriting of files. She's not asking permission anymore, she's asking forgiveness. Actually no, she's not asking anything, that's the point 😭
  • -g gamma β€” set the image gamma correction. If it's not present, she uses the png file's own gamma, or defaults to 1.0 if there isn't one.
  • -h β€” print program help. Your bestie when you're lost 🧚
  • -n colors β€” specifies the number of colors to quantize to. Defaults to 256, which is the maximum. The minimum here is 2. So like, two colors, that's the floor, don't go lower.
  • -Q dither β€” choose a dithering method. n = no dither (this is the default), f = Floyd Steinberg dithering. Pick your fighter ⭐
  • -s sample factor β€” the sample factor. The neuquant algorithm samples pixels stepping by this value. The default value of 3 gives good results. Higher values sample less of the image pixels, so they're faster but less accurate. A factor of 1 samples every single image pixel β€” main character energy, every pixel gets its moment πŸ‘‘
  • -v β€” verbose mode. Prints status messages. She'll tell you what she's doing, communication queen 🌈
  • -V β€” print version number and library versions. The receipts, fr fr.

πŸ’€ BUGS πŸ’€

Okay so, known issue: she does not deal correctly with greyscale alpha images with low bit depths. But β€” and this is the plot twist β€” those wont benefit from quantizing anyway, so honestly? Not the end of the world. Still, now you know πŸ™ˆ


πŸ‘‘ AUTHOR πŸ‘‘

Stuart Coyle <stuart.coyle@gmail.com>

The legend herself (well, himself, but we're being dramatic). Thank you for your service πŸ«‘πŸ’œ


πŸ¦‹ SEE ALSO πŸ¦‹

png(5)


Alright bestie, that's the whole page β€” PNGNQ(1), from the Linux User Manuals, dated MAY 2009. Go forth and quantize responsibly, and maybe don't pair -e .png with -f unless you're feeling brave πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from