---
name: "mipgen"
section: "1"
platform: "linux"
package: "libfilament-tools"
version: "1.9.25+dfsg3-1+b2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/mipgen"
---

# mipgen(1)

filament material tools

## NAME

mipgen - filament material tools

## DESCRIPTION

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\>

## OPTIONS

**--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

**--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

-

  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

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
