Repository navigation
Images
Supported conversion inputs include BMP, TGA, TIFF, WebP, GIF, PNM, HDR, DDS, ICO, QOI and EXR, in addition to JPG/PNG. Unsupported codecs, missing files and corrupt input images are errors. A texture whose written path leads nowhere is first looked for by name beside the file referring to it, unless --exact-paths is set; see Models from other people. Animation is reduced to the decoded image/frame.
--images auto keeps original image references when output and input are in the same folder and the image needs no conversion. It copies images otherwise. --images keep explicitly references original files using relative, escaped URIs; --images copy explicitly copies images. A kept reference must stay inside the output's folder unless --trusted is set; otherwise --images keep is a command-line error. Sources are never modified. Conversion always writes a new image in the output folder, even with --images keep.
A .glb output carries every image in its binary chunk instead, converted where needed, and writes no image file. --images auto and --images copy both embed, and --images keep is a command-line error.
JPG/JPEG and PNG textures are used as they are, since glTF can carry them directly. Every other format is converted to PNG, which is lossless and keeps alpha. 16-bit samples stay 16-bit. PNG has no floating-point samples, so a floating-point texture (EXR, HDR) is clamped to 0..1 and stored in 8 bits, with no tone mapping or transfer function applied.
mesh2gltf mesh.obj --images keep -o elsewhere/mesh.gltf --trusted
mesh2gltf mesh.obj --images copyConversion decodes one image at a time with the image library's allocation limits (default 512 MiB); its memory usage depends on image dimensions, separately from the bounded geometry pipeline. Unconverted JPG/PNG images use header checks and byte copies, without decoding all pixels.