Open rsms opened 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:
-resample_filter X
-resample_filter_scale X
-resample_ifgt
-resample_aspect
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.
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
This is great - I will merge this into latest.
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:
-resample_filter X
Set resample filter kernel, default is box, filters: box, tent, bell, blackman, catmullrom, mitchell, etc.-resample_filter_scale X
Set resample filter kernel's scale, lower=sharper, higher=more blurry, default is 1.0-resample_ifgt
Only resample if the image is larger than width or height provided with -resample-resample_aspect
Keep aspect ratio of image while resampling. "fit" the image inside the -resample rectangleI'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:
Resample inputs to fit within 512x512, maintaining their aspect ratio:
Resample inputs only if the width is larger than 1024 or if the height is larger than 512: