Skip to content

preview and save DDS textures from the command line

License

Notifications You must be signed in to change notification settings

isabella232/preview-dds

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

preview and save DDS textures from the command line

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 92.3%
  • CSS 3.5%
  • GLSL 2.4%
  • HTML 1.8%