This is the BC1 texture block encoder used by NVTT, extracted as an easy to use single header file library.
Since its initial release I've improved quality and performance. I've added support for multiple quality levels that allow reducing compression time at the cost of some quality, and I've vectorized some of the algorithms to take advantage of the vector units in modern CPUs.
This work was inspired by Rich Geldreich's RGBCX, which is a close competitor and most likely a better choice if you are looking for a well supported and actively developed library.
The following chart shows the average PSNR of different BC1 compressors and different configurations on the Kodim and Waterloo image sets plotted against the time it took to encode them:
three_color_mode
and three_color_black
set to true
.allow_3color
and use_transparent_texels_for_black
enabled.ICBC implements several algorithms: