How to convert an image to ETC2 format? (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 ETC2 --texture-format ktx2

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

Pixel formatBits per pixelDescription
ETC1_RGB4ETC1 compression, no alpha channel
ETC1_A4ETC1 compression, alpha channel only
ETC2_RGB4ETC2 compression, no alpha
ETC2_RGBA8ETC2 compression, color+alpha
Texture FormatDescription
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.
pkmETC texture container. Simple format for ETC1/ETC2 compressed textures.
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 Image quality can be configured with --etc1-quality <0-100> and --etc2-quality <0-100>, default value is 70.
For other options (scaling, trimming transparency, ...) have a look at the Image conversion documentation.