All Projects → Jam3 → preview-dds

Jam3 / preview-dds

Licence: MIT License
preview and save DDS textures from the command line

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects
GLSL
2045 projects
HTML
75241 projects

preview-dds

stable

Preview and convert DDS files from the command line (compressed textures and HDR cubemaps).

This only supports a limited range of DDS formats, see here.

Install

npm install preview-dds -g

Usage

NPM

The CLI options are as follows:

Usage:
  preview-dds file [opt]

Options:
  --level, -l   optional mipmap level (default 0)
  --face, -f    optional cubemap face to preview (default all)
  --output, -o  write image to stdout (default: not used)
  --quality, -q if output is JPG, encoder quality (0.0 - 1.0)

Basic Examples

Preview a cubemap as an unwrapped cross:

preview-dds my-cubemap.dds

Or, preview a single face and mipmap level of the cubemap:

preview-dds my-cubemap.dds --level=1 --face=px

Where face option can be a string like px, py, or pz -- or a number index into the faces array (see cube-face-name).

If no face is specified, all faces are shown together.

Convert DDS to PNG/JPG

You can also use this tool to extract compressed textures and cube faces from a DDS file, by specifying --output=png|jpg.

For example:

preview-dds my-cubemap.dds --output=jpg -q 0.8 -l 2 -f px > cube-face.jpg

The above writes a new file cube-face.jpg with a quality of 0.8, showing mipmap level 2 and the "positive x" face. Result:

face

The --output flag (or -o) defaults to PNG.

License

MIT, see LICENSE.md for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].