Texture compressor
CLI tool for texture compression using ASTC, ETC, PVRTC and S3TC in DDS or PVR containers.
Easily compress for all hardware using sensible defaults but with the option to pass any custom flag directly to the tool.
Installation
$ npm install -g --save texture-compressor
Example
ASTC
$ node ./bin/texture-compressor -i ./example/example.png -o ./example/example-astc.dds -m astc -c astc
ETC
$ node ./bin/texture-compressor -i ./example/example.png -o ./example/example-etc1.dds -m etc -c etc1
PVR
$ node ./bin/texture-compressor -i ./example/example.png -o ./example/example-pvrtc1.pvr -m pvr -c pvrtc1
S3TC
$ node ./bin/texture-compressor -i ./example/example.png -o ./example/example-dxt5.dds -m s3tc -c dxt5
Flags
Required
-c, --compression ['astc', 'etc1', 'etc2', 'pvrtc1', 'dxt1', 'dxt3', 'dxt5'] [required]
-i, --input [example: ./example/example.png] [required]
-o, --output [example: ./example/example.dds] [required]
-m, --method ['astc', 'etc', 'pvr', 's3tc'] [required]
Optional
-b, --bitrate [2.0 - 4.0, default: 2.0 = 8x8 blocksize] [not required]
Or if using ASTC you can optionally change the bitrate for one of the following blocksizes:
[4x4, 5x4, 5x5, 6x5, 6x6, 8x5, 8x6, 8x8, 10x5, 10x6, 10x8, 10x10, 12x10, 12x12] [not required]
-q, --quality [0 - 10, default: 5] [not required]
-t, --transparant [true / false, default: false] [not required]
Tool flags
-f, --flags ["flag value" "flag value"] [not required]
Licence
My work is released under the MIT licence.
Much has been based on the automated texture compression tool baked into gltf-pipeline.
This repository distributes multiple binary tools for Windows, Mac and Linux.