UNU-QUANTIZE(1)
π UNU-QUANTIZE π
okay bestie, welcome to the unu-quantize page, part of the User Commands lineup in the unu manual. it's giving "shrink your numbers, keep your vibes". let's get into it π«Ά
β¨ NAME β¨
unu-quantize β quantize values to 8, 16, or 32 bits π
πΈ SYNOPSIS πΈ
unu quantize -b,--bits <bits> [-min,--minimum <value>] [-max,--maximum
<value>] [-hb,--bins <bins>] [-blind8 <bool>] [-i,--input <nin>]
[-o,--output <nout>]
π¦ DESCRIPTION π¦
so like, the whole point: quantize values to 8, 16, or 32 bits. that's the assignment and it ate π₯
your input values can be fixed point (think quantizing ushorts down to uchars, the classic glow-down) or floating point. either way, values get clamped to the min and max before they get quantized, so there's literally no risk of getting 255 where you expect 0 (with unsigned char output, for example). no cap, that would be so embarrassing π
the min and max can be specified explicitly (as a regular number), or in terms of percentiles β that's a number suffixed with %, and there is no space in between, bestie, keep them glued together.
heads up though: this does only linear quantization. that's the whole vibe, don't come looking for anything fancier π
also go look at unu-convert(1), unu-2op(1) x, and unu-3op(1) clamp β the trio of related icons, iykyk.
- Uses
nrrdQuantizeβ¨
π OPTIONS π
-b <bits>,--bits <bits>β the number of bits to quantize down to. this one decides the type of your output nrrd, so it's kinda the main character here π"8"β unsigned char"16"β unsigned short"32"β unsigned int
-min <value>,--minimum <value>β the value to map to zero. give it as a regular number, or, if the number has a"%"suffix, this minimum is specified in terms of the percentage of samples in input that are lower."0%"means the lowest input value gets used;"1%"means that the 1% of the lowest values are all mapped to zero. and by default (aka when you don't use this option at all), the lowest input value is used. (string); default:"nan"πΈ-max <value>,--maximum <value>β the value to map to the highest unsigned integral value. same deal: give it explicitly as a regular number, or, if the number has a"%"suffix, this maximum is specified in terms of the percentage of samples in input that are higher."0%"means the highest input value is used β which is also the default behavior (same as not using this option). (string); default:"nan"β¨-hb <bins>,--bins <bins>β number of bins in the histogram of values, used for determining min or max by percentiles. and listen, this has to be large enough so that any errant very high or very low values don't compress the interesting part of the histogram to an inscrutably small number of bins. like, don't do that to yourself. (unsigned int); default:"5000"π-blind8 <bins>β if you're not using"-min"or"-max", this is whether to know the range of 8-bit data blindly (uchar is always[0,255], signed char is[-128,127]). (bool); default:"true","true"π-i <nin>,--input <nin>β input nrrd π-o <nout>,--output <nout>β output nrrd (string); default:"-"π
π₯ SEE ALSO π₯
unu(1), unu-unquantize(1), unu-convert(1), unu-2op(1) x, unu-3op(1) clamp
bestie reminder:-minand-maxdefault to"nan", which is the whole "just use the actual lowest/highest input value" vibe. don't fight it π
okay that's the page, you absolutely ate this one π«Ά and for the cute lil sign-off: this gorgeous piece of documentation is living its August 2021 era, from the UNU-QUANTIZE(1) manual, under User Commands. periodt. π
β¨
π¦ where this page comes from
- fedora 43: teem 1.11.0-83.fc43 Β· LGPL-2.1-or-later WITH LicenseRef-Fedora-Temporary-Simple-Library-exception
- fedora 43: teem 1.11.0-86.fc43 Β· LGPL-2.1-or-later WITH Simple-Library-Usage-exception
- fedora 44: teem 1.11.0-87.fc44 Β· LGPL-2.1-or-later WITH Simple-Library-Usage-exception
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms