How to convert an image to DXT? (DDS or KTX file)

With TexturePacker's --convert-texture command line option you can easily convert a single image to a different format:

TexturePacker --convert-texture input.png \
              --pixel-format DXT5 --texture-format ktx

The pixel format specifies the compression algorithm to use, the texture format describes the file container. The following formats are supported for S3TC/DXT/BCn compression:

Pixel formatBits per pixelDescription
DXT14DXT1 compression, 1 bit transparency
DXT58DXT5 compression, transparency
Texture FormatDescription
ddsDirectDraw Surface. Standard format for DirectX applications.
ktxKhronos Texture. Standard container for OpenGL ES textures.
ktx2Khronos Texture (Version 2). Newer format with Basis Universal support.
zktxKhronos Texture (gzip compressed). KTX file compressed for smaller storage.
pvr3PowerVR Texture Format. Native format for iOS and PowerVR GPUs.
pvr3gzPowerVR Texture Format, compressed with gzip. Smaller on disk, decompressed at load time.
pvr3cczPowerVR Texture Format, compressed with zlib, cocos2d header.

The quantization can be configured with --dxt-mode [DXT_LINEAR|DXT_PERCEPTUAL], default value is DXT_PERCEPTUAL.
For other options (scaling, trimming transparency, ...) have a look at the Image conversion documentation.