BinomialLLC / basis_universal

Basis Universal GPU Texture Codec
Apache License 2.0
2.72k stars 267 forks source link

Adds CLI options for finer control of input resampling #280

Open rsms opened 2 years ago

rsms commented 2 years ago

First off, thank you for this lovely software!

This patch adds four command-line options to the encoder tool for increased control of input preprocessing resampling:

I've tried my best to match the style of the existing code and have of course tested all this with a bunch of different inputs.

Examples

Resample inputs using lanczos3 filter with a 0.8 scale factor:

basisu -resample 512 512 -resample_filter lanczos3 -resample_filter_scale 0.8 a.png

Resample inputs to fit within 512x512, maintaining their aspect ratio:

basisu -resample 512 512 -resample_aspect a.png

Resample inputs only if the width is larger than 1024 or if the height is larger than 512:

basisu -resample 1024 512 -resample_ifgt a.png
richgel999 commented 2 years ago

This is great - I will merge this into latest.