MIPGEN(1)

πŸ’– mipgen β€” user commands, section 1 πŸ’–

okay bestie, sit down, hydrate, this is the manual page for mipgen 🫢 it lives in the User Commands corner of your man pages, it's mipgen, and it's here to make mipmaps for you. no cap. πŸ’…


✨ NAME ✨

  • mipgen β€” filament material tools 🌸

✨ DESCRIPTION ✨

so mipgen generates mipmaps for an image, and it goes all the way down to the 1x1 level. yes. one whole pixel. iconic behaviour honestly. πŸ”₯

the <output_pattern> argument is a printf-style pattern. for example, "mip%2d.png" generates mip01.png, mip02.png, etc. and listen β€” miplevel 0 is not generated, because that's just the original image, bestie, we already have it πŸ’€

if the output format is a container format like KTX, then <output_pattern> is simply a filename. that's it. no pattern shenanigans.

Usage:

mipgen [options] <input_file> <output_pattern>

✨ OPTIONS ✨

okay here's the menu, everything on it, no skips 🌈

  • --help, -h β€” print this message
  • --license, -L β€” print copyright and license information
  • --linear, -l β€” assume that image pixels are already linearized
  • --page, -p β€” generate HTML page for review purposes (mipmap.html)
  • --quiet, -q β€” suppress console output from the mipgen tool
  • --grayscale, -g β€” create a single-channel image and do not perform gamma correction
  • --format=[exr|hdr|rgbm|psd|png|dds|ktx], -f [exr|hdr|rgbm|psd|png|dds|ktx] β€” specify output file format, inferred from output pattern if omitted
  • --kernel=[box|nearest|hermite|gaussian|normals|mitchell|lanczos|min], -k [filter] β€” specify filter kernel type (defaults to lanczos) β€” and heads up, the normals filter may automatically change the compression scheme 😳
  • --add-alpha β€” if the source image has 3 channels, this adds a fourth channel filled with 1.0
  • --strip-alpha β€” ignore the alpha component of the input image
  • --mip-levels=N, -m N β€” specifies the number of mip levels to generate; if 0 (default), all levels are generated
  • --compression=COMPRESSION, -c COMPRESSION β€” format specific compression:

KTX:

astc_[fast|thorough]_[ldr|hdr]_WxH, where WxH is a valid block
size s3tc_rgb_dxt1, s3tc_rgba_dxt5 etc_FORMAT_METRIC_EFFORT
FORMAT is r11, signed_r11, rg11, signed_rg11, rgb8, srgb8, rgb8_alpha
srgb8_alpha, rgba8, or srgb8_alpha8
METRIC is rgba, rgbx, rec709, numeric, or normalxyz EFFORT is an
integer between 0 and 100
PNG: Ignored Radiance: Ignored Photoshop: 16 (default), 32
OpenEXR: RAW, RLE, ZIPS, ZIP, PIZ (default) DDS: 8, 16 (default),
32

✨ OPTIONS, round two (the page really does print them twice, and we respect the bit) ✨

  • --help, -h β€” print this message
  • --license, -L β€” print copyright and license information
  • --linear, -l β€” assume that image pixels are already linearized
  • --page, -p β€” generate HTML page for review purposes (mipmap.html)
  • --quiet, -q β€” suppress console output from the mipgen tool
  • --grayscale, -g β€” create a single-channel image and do not perform gamma correction
  • --format=[exr|hdr|rgbm|psd|png|dds|ktx], -f [exr|hdr|rgbm|psd|png|dds|ktx] β€” specify output file format, inferred from output pattern if omitted
  • --kernel=[box|nearest|hermite|gaussian|normals|mitchell|lanczos|min], -k [filter] β€” specify filter kernel type (defaults to lanczos) β€” the normals filter may automatically change the compression scheme
  • --add-alpha β€” if the source image has 3 channels, this adds a fourth channel filled with 1.0
  • --strip-alpha β€” ignore the alpha component of the input image
  • --mip-levels=N, -m N β€” specifies the number of mip levels to generate; if 0 (default), all levels are generated
  • --compression=COMPRESSION, -c COMPRESSION β€” format specific compression:

KTX:

astc_[fast|thorough]_[ldr|hdr]_WxH, where WxH is a valid block
size s3tc_rgb_dxt1, s3tc_rgba_dxt5 etc_FORMAT_METRIC_EFFORT
FORMAT is r11, signed_r11, rg11, signed_rg11, rgb8, srgb8, rgb8_alpha
srgb8_alpha, rgba8, or srgb8_alpha8
METRIC is rgba, rgbx, rec709, numeric, or normalxyz EFFORT is an
integer between 0 and 100
PNG: Ignored Radiance: Ignored Photoshop: 16 (default), 32
OpenEXR: RAW, RLE, ZIPS, ZIP, PIZ (default) DDS: 8, 16 (default),
32

✨ EXAMPLES ✨

here's the receipts, copy-paste energy πŸŽ€

mipgen -g --kernel=hermite grassland.png mip_%03d.png
mipgen -f ktx --compression=astc_fast_ldr_4x4 grassland.png mips.ktx
mipgen -f ktx --compression=etc_rgb_rgba_40 grassland.png mips.ktx

and since the page says it again, we say it again, because consistency ✨

so mipgen generates mipmaps for an image down to the 1x1 level.

the <output_pattern> argument is a printf-style pattern. for example, "mip%2d.png" generates mip01.png, mip02.png, etc. miplevel 0 is not generated since it is the original image.

if the output format is a container format like KTX, then <output_pattern> is simply a filename.

Usage:

mipgen [options] <input_file> <output_pattern>
mipgen -g --kernel=hermite grassland.png mip_%03d.png
mipgen -f ktx --compression=astc_fast_ldr_4x4 grassland.png mips.ktx
mipgen -f ktx --compression=etc_rgb_rgba_40 grassland.png mips.ktx

bestie reminder 🫢 everything above is exactly what the page says β€” options, defaults, formats, all of it. don't come for me if you skip a flag, that's on you πŸ’€

and that's the whole page!! this one's from mipgen, dated October 2021, and it's giving peak utility 🌈 go make some mipmaps, you've got this. periodt. πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ‘‘